Move toasts in calls up and fix click to dismiss

This commit is contained in:
Jamie Kyle 2024-05-15 17:07:13 -07:00 committed by GitHub
parent 31cbb89b0d
commit 8fd3059de8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 4 deletions

View file

@ -29,6 +29,7 @@ export type PropsType = {
centerToast?: boolean;
containerWidthBreakpoint: WidthBreakpoint | null;
isCompositionAreaVisible?: boolean;
isInFullScreenCall: boolean;
};
const SHORT_TIMEOUT = 3 * SECOND;
@ -554,8 +555,12 @@ export function renderMegaphone({
}
export function ToastManager(props: PropsType): JSX.Element {
const { centerToast, containerWidthBreakpoint, isCompositionAreaVisible } =
props;
const {
centerToast,
containerWidthBreakpoint,
isCompositionAreaVisible,
isInFullScreenCall,
} = props;
const toast = renderToast(props);
@ -569,7 +574,13 @@ export function ToastManager(props: PropsType): JSX.Element {
>
{centerToast
? createPortal(
<div className="ToastManager__root">{toast}</div>,
<div
className={classNames('ToastManager__root', {
'ToastManager--full-screen-call': isInFullScreenCall,
})}
>
{toast}
</div>,
document.body
)
: toast}