From 7a03b91c9348764c5ea00861be632ed797035ff2 Mon Sep 17 00:00:00 2001 From: GigiaJ Date: Mon, 21 Apr 2025 01:38:08 -0400 Subject: [PATCH] Create NavBottom for call status --- src/app/pages/call/CallNavBottom.tsx | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/app/pages/call/CallNavBottom.tsx diff --git a/src/app/pages/call/CallNavBottom.tsx b/src/app/pages/call/CallNavBottom.tsx new file mode 100644 index 00000000..d4ff7a43 --- /dev/null +++ b/src/app/pages/call/CallNavBottom.tsx @@ -0,0 +1,65 @@ +import { logger } from 'matrix-js-sdk/lib/logger'; +import { useMatrixClient } from '../../hooks/useMatrixClient'; +import { useCallState } from '../client/CallProvider'; +import { Box, Text } from 'folds'; + +export function CallNavBottom() { + const { + sendWidgetAction, + activeCallRoomId, + isAudioEnabled, + isVideoEnabled, + toggleAudio, + toggleVideo, + hangUp, + } = useCallState(); + const mx = useMatrixClient(); + const userName = mx.getUser(mx.getUserId() ?? '')?.displayName ?? mx.getUserId() ?? 'User'; + + const handleSendMessageClick = () => { + const action = 'my.custom.action'; + const data = { message: `Hello from ${userName}!` }; + logger.debug(`FixedBottomNavArea: Sending action '${action}'`); + sendWidgetAction(action, data) + .then(() => logger.info(`FixedBottomNavArea: Action '${action}' sent.`)) + .catch((err) => logger.error(`FixedBottomNavArea: Failed action '${action}':`, err)); + }; + + if (!activeCallRoomId) { + return ( + + + No active call + + + ); + } + + return ( + + + {/* Going to need better icons for this */} + + + + + + + {mx.getRoom(activeCallRoomId)?.normalizedName} + + ); +}