diff --git a/src/components/CallFooter.stories.tsx b/src/components/CallFooter.stories.tsx index f95751094..667cb6070 100644 --- a/src/components/CallFooter.stories.tsx +++ b/src/components/CallFooter.stories.tsx @@ -127,6 +127,7 @@ export const Default: Story = { showFooter: true, hideControls: false, asOverlay: false, + showModals: true, sharingScreen: false, audioOutputSwitcher: undefined, reactionIdentifier: undefined, diff --git a/src/components/CallFooter.tsx b/src/components/CallFooter.tsx index b3e0e4f30..4f79f236c 100644 --- a/src/components/CallFooter.tsx +++ b/src/components/CallFooter.tsx @@ -77,6 +77,7 @@ export interface FooterState { /** The footer should be used as an overlay. * (Over the Call Grid) This saves spaces on small screens. */ asOverlay: boolean; + showModals: boolean; buttonSize: "md" | "lg"; showLogo: boolean; @@ -121,6 +122,7 @@ export const CallFooter: FC = ({ const asOverlay = useBehavior(vm.asOverlay$); const showFooter = useBehavior(vm.showFooter$); const hideControls = useBehavior(vm.hideControls$); + const showModals = useBehavior(vm.showModals$); const layoutSwitchVm = useBehavior(vm.layoutSwitchVm$); const openSettings = useBehavior(vm.openSettings$); const audioEnabled = useBehavior(vm.audioEnabled$); @@ -235,7 +237,8 @@ export const CallFooter: FC = ({ ); } - if (reactionIdentifier && reactionData) { + // Reaction button contains a pretty large menu, so treat it like a modal + if (reactionIdentifier && reactionData && showModals) { buttons.push( {}), } as unknown as CallViewModel; diff --git a/src/components/CallFooterViewModel.tsx b/src/components/CallFooterViewModel.tsx index a374a0258..7e391b169 100644 --- a/src/components/CallFooterViewModel.tsx +++ b/src/components/CallFooterViewModel.tsx @@ -161,6 +161,7 @@ export function createCallFooterViewModel( // candidat to move into the FooterViewModel showFooter$: callModel.showFooter$, hideControls$: constant(!showControls), + showModals$: callModel.showModals$, asOverlay$: callModel.edgeToEdge$, buttonSize$: scope.behavior( isPip$.pipe(map((pip) => (pip ? "md" : "lg"))), @@ -168,12 +169,12 @@ export function createCallFooterViewModel( openSettings$: scope.behavior( combineLatest([ - isPip$, + callModel.showModals$, callModel.showHeader$, callModel.setSettingsOpen$, ]).pipe( - map(([isPip, showHeader, setSettingsOpen]) => - !isPip && headerStyle !== HeaderStyle.AppBar && showControls + map(([showModals, showHeader, setSettingsOpen]) => + showModals && headerStyle !== HeaderStyle.AppBar && showControls ? (): void => setSettingsOpen(true) : undefined, ), @@ -239,6 +240,7 @@ export function createLobbyFooterViewModel( showLogo, hideControls: false, asOverlay: false, + showModals: true, buttonSize: "lg", openSettings, hangup, diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 322380eee..cab450bc5 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -261,6 +261,7 @@ export const InCallView: FC = ({ const overflowing = useBehavior(vm.overflowing$); const showNameTags = useBehavior(vm.showNameTags$); const showHeader = useBehavior(vm.showHeader$); + const showModals = useBehavior(vm.showModals$); const settingsOpen = useBehavior(vm.settingsOpen$); const setSettingsOpen = useBehavior(vm.setSettingsOpen$); const earpieceMode = useBehavior(vm.earpieceMode$); @@ -622,7 +623,7 @@ export const InCallView: FC = ({ {earpieceOverlay} {footer} - {layout.type !== "pip" && ( + {showModals && ( <> ; + /** + * Whether modals such as settings and reactions should be accessible at all. + */ + showModals$: Behavior; + settingsOpen$: Behavior; setSettingsOpen$: Behavior<(open: boolean) => void>; @@ -1450,6 +1455,11 @@ export function createCallViewModel$( map((naturallyShowFooter) => naturallyShowFooter && showFooterUrlParams), ), ); + + const showModals$ = scope.behavior( + windowMode$.pipe(map((mode) => mode !== "pip")), + ); + const settingsOpen$ = new BehaviorSubject(false); const setSettingsOpen$ = constant((open: boolean) => { settingsOpen$.next(open); @@ -1826,6 +1836,7 @@ export function createCallViewModel$( showNameTags$, showHeader$: showHeader$, showFooter$: showFooter$, + showModals$, settingsOpen$: settingsOpen$, setSettingsOpen$: setSettingsOpen$, edgeToEdge$,