Update call lobby UI to match new designs

This commit is contained in:
Evan Hahn 2021-08-17 16:45:18 -05:00 committed by GitHub
parent 50c4fa06cc
commit 763c35e546
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 857 additions and 435 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React, { MouseEventHandler, ReactNode } from 'react';
import React, { CSSProperties, MouseEventHandler, ReactNode } from 'react';
import classNames from 'classnames';
import { assert } from '../util/assert';
@ -17,12 +17,15 @@ export enum ButtonVariant {
SecondaryAffirmative,
SecondaryDestructive,
Destructive,
Calling,
}
type PropsType = {
className?: string;
disabled?: boolean;
size?: ButtonSize;
style?: CSSProperties;
tabIndex?: number;
variant?: ButtonVariant;
} & (
| {
@ -64,6 +67,7 @@ const VARIANT_CLASS_NAMES = new Map<ButtonVariant, string>([
'module-Button--secondary module-Button--secondary--destructive',
],
[ButtonVariant.Destructive, 'module-Button--destructive'],
[ButtonVariant.Calling, 'module-Button--calling'],
]);
export const Button = React.forwardRef<HTMLButtonElement, PropsType>(
@ -73,6 +77,8 @@ export const Button = React.forwardRef<HTMLButtonElement, PropsType>(
className,
disabled = false,
size = ButtonSize.Medium,
style,
tabIndex,
variant = ButtonVariant.Primary,
} = props;
const ariaLabel = props['aria-label'];
@ -105,6 +111,8 @@ export const Button = React.forwardRef<HTMLButtonElement, PropsType>(
disabled={disabled}
onClick={onClick}
ref={ref}
style={style}
tabIndex={tabIndex}
// The `type` should either be "button" or "submit", which is effectively static.
// eslint-disable-next-line react/button-has-type
type={type}