From 86f5b9888c8979ac1184fa8a52c5a0386641e7de Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 30 Apr 2026 18:11:14 +0200 Subject: [PATCH] User button in footer --- src/components/CallFooter.stories.tsx | 18 +++++ src/components/CallFooter.tsx | 94 ++++++++++++++++++++++----- 2 files changed, 94 insertions(+), 18 deletions(-) diff --git a/src/components/CallFooter.stories.tsx b/src/components/CallFooter.stories.tsx index 6062d0bb..b11fcc6d 100644 --- a/src/components/CallFooter.stories.tsx +++ b/src/components/CallFooter.stories.tsx @@ -88,6 +88,24 @@ export const Default: Story = { }, }; +export const WithAudioAndVideoOptions: Story = { + ...Default, + args: { + ...Default.args, + audioEnabled: false, + videoEnabled: true, + audioOptions: [ + { label: "Microphone 1", id: "1" }, + { label: "Microphone 2", id: "2" }, + ], + videoOptions: [ + { label: "Camera 1", id: "1" }, + { label: "Camera 2", id: "2" }, + ], + selectedAudio: "2", + selectedVideo: "1", + }, +}; export const WithLogo: Story = { ...Default, args: { diff --git a/src/components/CallFooter.tsx b/src/components/CallFooter.tsx index fdedf36c..c0ced063 100644 --- a/src/components/CallFooter.tsx +++ b/src/components/CallFooter.tsx @@ -8,6 +8,14 @@ Please see LICENSE in the repository root for full details. import { type FC, type JSX, type Ref, useMemo } from "react"; import classNames from "classnames"; import { BehaviorSubject } from "rxjs"; +import { + MicOffSolidIcon, + MicOnSolidIcon, + MicOnIcon, + VideoCallSolidIcon, + VideoCallIcon, + VideoCallOffSolidIcon, +} from "@vector-im/compound-design-tokens/assets/web/icons"; import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; @@ -25,6 +33,10 @@ import { import styles from "./CallFooter.module.css"; import { LayoutToggle } from "../room/LayoutToggle"; import { type GridMode } from "../state/CallViewModel/CallViewModel"; +import { + MediaMuteAndSwitchButton, + type MenuOptions, +} from "./MediaMuteAndSwitchButton"; export interface AudioOutputSwitcher { targetOutput: string; @@ -74,6 +86,11 @@ export interface FooterProps { // debug stuff debugTileLayout?: boolean; tileStoreGeneration?: number; + + audioOptions?: MenuOptions[]; + videoOptions?: MenuOptions[]; + selectedAudio?: string; + selectedVideo?: string; } export const CallFooter: FC = ({ @@ -99,6 +116,11 @@ export const CallFooter: FC = ({ hangup, debugTileLayout, tileStoreGeneration, + + audioOptions, + videoOptions, + selectedAudio, + selectedVideo, }) => { const buttons: JSX.Element[] = []; const buttonSize = asPip ? "md" : "lg"; @@ -120,24 +142,60 @@ export const CallFooter: FC = ({ ); } - buttons.push( - , - , - ); + if ((audioOptions?.length ?? 0) > 0) { + buttons.push( + , + ); + } else { + buttons.push( + , + ); + } + if ((videoOptions?.length ?? 0) > 0) { + buttons.push( + , + ); + } else { + buttons.push( + , + ); + } if (toggleScreenSharing !== undefined) { buttons.push(