Let users ring members when starting a group call

Co-Authored-By: Josh Perez <60019601+josh-signal@users.noreply.github.com>
This commit is contained in:
Evan Hahn 2021-08-25 16:42:51 -05:00 committed by GitHub
parent 4afe4649ec
commit 0e7f641dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 556 additions and 97 deletions

View file

@ -16,6 +16,9 @@ export enum CallingButtonType {
PRESENTING_DISABLED = 'PRESENTING_DISABLED',
PRESENTING_OFF = 'PRESENTING_OFF',
PRESENTING_ON = 'PRESENTING_ON',
RING_DISABLED = 'RING_DISABLED',
RING_OFF = 'RING_OFF',
RING_ON = 'RING_ON',
VIDEO_DISABLED = 'VIDEO_DISABLED',
VIDEO_OFF = 'VIDEO_OFF',
VIDEO_ON = 'VIDEO_ON',
@ -24,6 +27,7 @@ export enum CallingButtonType {
export type PropsType = {
buttonType: CallingButtonType;
i18n: LocalizerType;
isVisible?: boolean;
onClick: () => void;
tooltipDirection?: TooltipPlacement;
};
@ -31,6 +35,7 @@ export type PropsType = {
export const CallingButton = ({
buttonType,
i18n,
isVisible = true,
onClick,
tooltipDirection,
}: PropsType): JSX.Element => {
@ -70,6 +75,21 @@ export const CallingButton = ({
classNameSuffix = 'hangup';
tooltipContent = i18n('calling__hangup');
label = i18n('calling__hangup');
} else if (buttonType === CallingButtonType.RING_DISABLED) {
classNameSuffix = 'ring--disabled';
disabled = true;
tooltipContent = i18n(
'calling__button--ring__disabled-because-group-is-too-large'
);
label = i18n('calling__button--ring__label');
} else if (buttonType === CallingButtonType.RING_OFF) {
classNameSuffix = 'ring--off';
tooltipContent = i18n('calling__button--ring__on');
label = i18n('calling__button--ring__label');
} else if (buttonType === CallingButtonType.RING_ON) {
classNameSuffix = 'ring--on';
tooltipContent = i18n('calling__button--ring__off');
label = i18n('calling__button--ring__label');
} else if (buttonType === CallingButtonType.PRESENTING_DISABLED) {
classNameSuffix = 'presenting--disabled';
tooltipContent = i18n('calling__button--presenting-disabled');
@ -96,7 +116,12 @@ export const CallingButton = ({
direction={tooltipDirection}
theme={Theme.Dark}
>
<div className="module-calling-button__container">
<div
className={classNames(
'module-calling-button__container',
!isVisible && 'module-calling-button__container--hidden'
)}
>
<button
aria-label={tooltipContent}
className={className}