diff --git a/src/button/Button.tsx b/src/button/Button.tsx index 175cb22d..7d592623 100644 --- a/src/button/Button.tsx +++ b/src/button/Button.tsx @@ -22,6 +22,7 @@ import { } from "@vector-im/compound-design-tokens/assets/web/icons"; import styles from "./Button.module.css"; +import inCallViewStyles from "../room/InCallView.module.css"; import { platform } from "../Platform"; interface MicButtonProps extends ComponentPropsWithoutRef<"button"> { @@ -159,6 +160,10 @@ export const LoudspeakerButton: FC = (props) => { interface SettingsButtonProps extends ComponentPropsWithoutRef<"button"> { size?: "sm" | "lg"; + /** If the button should be styled so it fits into the footer center buttons group + * This implies the button will be hidden unless we are on very small screens. + */ + forButtonsBar?: boolean; } export const SettingsButton: FC = (props) => { const { t } = useTranslation(); @@ -166,11 +171,15 @@ export const SettingsButton: FC = (props) => { return ( diff --git a/src/components/InCallFooter.stories.tsx b/src/components/InCallFooter.stories.tsx index 336884a4..fb7b5ba5 100644 --- a/src/components/InCallFooter.stories.tsx +++ b/src/components/InCallFooter.stories.tsx @@ -33,8 +33,8 @@ export const Default: Story = { asOverlay: false, showFooter: true, showControls: true, - showSettingsButton: true, - showLogo: false, + hideSettingsButton: false, + hideLogo: false, asPip: false, gridMode: "grid", audioEnabled: true, @@ -78,7 +78,7 @@ export const WithLogo: Story = { ...Default, args: { ...Default.args, - showLogo: true, + hideLogo: false, }, }; export const WithAudioOutput: Story = { @@ -101,7 +101,7 @@ export const NoControlsWithLogo: Story = { args: { ...Default.args, showControls: false, - showLogo: true, + hideLogo: false, }, }; @@ -118,7 +118,7 @@ export const MobileLayout: Story = { ...Default, args: { ...Default.args, - showLogo: true, + hideLogo: true, debugTileLayout: true, tileStoreGeneration: 74, audioOutputSwitcher: null, diff --git a/src/components/InCallFooter.tsx b/src/components/InCallFooter.tsx index 8a25bde3..49293b46 100644 --- a/src/components/InCallFooter.tsx +++ b/src/components/InCallFooter.tsx @@ -38,8 +38,8 @@ export interface InCallFooterProps { asOverlay: boolean; showFooter: boolean; showControls: boolean; - showSettingsButton: boolean; - showLogo: boolean; + hideSettingsButton: boolean; + hideLogo: boolean; asPip: boolean; gridMode: GridMode; setGridMode: (mode: GridMode) => void; @@ -64,8 +64,8 @@ export const InCallFooter: FC = ({ asOverlay, showFooter, showControls, - showSettingsButton, - showLogo, + hideSettingsButton, + hideLogo, asPip, gridMode, setGridMode, @@ -86,6 +86,17 @@ export const InCallFooter: FC = ({ }) => { const buttons: JSX.Element[] = []; const buttonSize = asPip ? "sm" : "lg"; + const showSettingsButton = !hideSettingsButton && !asPip && showControls; + const showLayoutSwitcher = !asPip && showControls; + const showLogoDebugContainer = !asPip || (!hideLogo && !debugTileLayout); + const showLogo = !hideLogo && !asPip; + if (showSettingsButton) { + // add the settings button to the center group of buttons, so it will be visible on small screens. + // On larger screens, it will be hidden and the one without `forButtonsBar` in the `settingsLogoContainer` will be visible. + buttons.push( + , + ); + } buttons.push( = ({ />, ); - const logo = ( + const logoDebugContainer = (
{showLogo && ( <> @@ -183,15 +194,15 @@ export const InCallFooter: FC = ({ })} >
- {showControls && showSettingsButton && !asPip && ( + {showSettingsButton && ( )} - {(!asPip || (!showLogo && !debugTileLayout)) && logo} + {showLogoDebugContainer && logoDebugContainer}
{showControls &&
{buttons}
} - {showControls && !asPip && ( + {showLayoutSwitcher && (