diff --git a/src/app/features/room-nav/RoomCallNavStatus.tsx b/src/app/features/room-nav/RoomCallNavStatus.tsx index f034c027..9b4313fc 100644 --- a/src/app/features/room-nav/RoomCallNavStatus.tsx +++ b/src/app/features/room-nav/RoomCallNavStatus.tsx @@ -1,4 +1,15 @@ -import { Box, Chip, Icon, IconButton, Icons, Text, Tooltip, TooltipProvider } from 'folds'; +import { + Box, + Chip, + Icon, + IconButton, + Icons, + Text, + Tooltip, + TooltipProvider, + color, + config, +} from 'folds'; import React from 'react'; import { useMatrixClient } from '../../hooks/useMatrixClient'; import { useCallState } from '../../pages/client/call/CallProvider'; @@ -9,17 +20,18 @@ export function CallNavStatus() { activeCallRoomId, isAudioEnabled, isVideoEnabled, - isActiveCallReady, toggleAudio, toggleVideo, hangUp, } = useCallState(); const mx = useMatrixClient(); const { navigateRoom } = useRoomNavigate(); - if (!isActiveCallReady || !activeCallRoomId) return null; + const hasActiveCall = Boolean(activeCallRoomId); const handleGoToCallRoom = () => { - navigateRoom(activeCallRoomId); + if (activeCallRoomId) { + navigateRoom(activeCallRoomId); + } }; return ( @@ -27,78 +39,47 @@ export function CallNavStatus() { direction="Column" style={{ flexShrink: 0, - borderTop: `1px solid #e0e0e0`, - justifyContent: 'center', + borderTop: `${config.borderWidth.B300} solid ${color.Background.ContainerLine}`, + padding: `${config.space.S200} ${config.space.S200}`, }} > - - {/* Going to need better icons for this */} - - - - Go to Room - - } - > - {(triggerRef) => ( - - - - {activeCallRoomId ? mx.getRoom(activeCallRoomId)?.name : ''} - - - )} - + + + {hasActiveCall && ( + + Go to Room + + } + > + {(triggerRef) => ( + + + + {mx.getRoom(activeCallRoomId)?.name ?? ''} + + + )} + + )} - - - - {!isAudioEnabled ? 'Unmute' : 'Mute'} - - } - > - {(triggerRef) => ( - - - - )} - - - {!isVideoEnabled ? 'Video On' : 'Video Off'} - - } - > - {(triggerRef) => ( - - - - )} - - + {hasActiveCall && ( ( )} - + )} + + {!isAudioEnabled ? 'Unmute' : 'Mute'} + + } + > + {(triggerRef) => ( + + + + )} + + + {!isVideoEnabled ? 'Video On' : 'Video Off'} + + } + > + {(triggerRef) => ( + + + + )} + );