style: blend header and room input button styles in call nav
This commit is contained in:
parent
4f498af458
commit
afac47d312
2 changed files with 36 additions and 61 deletions
21
src/app/features/room-nav/RoomCallNavStatus.css.ts
Normal file
21
src/app/features/room-nav/RoomCallNavStatus.css.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { style } from '@vanilla-extract/css';
|
||||||
|
import { config } from 'folds';
|
||||||
|
|
||||||
|
export const Actions = style({
|
||||||
|
padding: config.space.S200,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const RoomButtonWrap = style({
|
||||||
|
minWidth: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const RoomButton = style({
|
||||||
|
width: '100%',
|
||||||
|
minWidth: 0,
|
||||||
|
padding: `0 ${config.space.S200}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const RoomName = style({
|
||||||
|
flexGrow: 1,
|
||||||
|
minWidth: 0,
|
||||||
|
});
|
||||||
|
|
@ -1,29 +1,13 @@
|
||||||
import {
|
import { Box, Chip, Icon, IconButton, Icons, Line, Text, Tooltip, TooltipProvider } from 'folds';
|
||||||
Box,
|
|
||||||
Chip,
|
|
||||||
Icon,
|
|
||||||
IconButton,
|
|
||||||
Icons,
|
|
||||||
Text,
|
|
||||||
Tooltip,
|
|
||||||
TooltipProvider,
|
|
||||||
color,
|
|
||||||
config,
|
|
||||||
} from 'folds';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||||
import { useCallState } from '../../pages/client/call/CallProvider';
|
import { useCallState } from '../../pages/client/call/CallProvider';
|
||||||
import { useRoomNavigate } from '../../hooks/useRoomNavigate';
|
import { useRoomNavigate } from '../../hooks/useRoomNavigate';
|
||||||
|
import * as css from './RoomCallNavStatus.css';
|
||||||
|
|
||||||
export function CallNavStatus() {
|
export function CallNavStatus() {
|
||||||
const {
|
const { activeCallRoomId, isAudioEnabled, isVideoEnabled, toggleAudio, toggleVideo, hangUp } =
|
||||||
activeCallRoomId,
|
useCallState();
|
||||||
isAudioEnabled,
|
|
||||||
isVideoEnabled,
|
|
||||||
toggleAudio,
|
|
||||||
toggleVideo,
|
|
||||||
hangUp,
|
|
||||||
} = useCallState();
|
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
const { navigateRoom } = useRoomNavigate();
|
const { navigateRoom } = useRoomNavigate();
|
||||||
const hasActiveCall = Boolean(activeCallRoomId);
|
const hasActiveCall = Boolean(activeCallRoomId);
|
||||||
|
|
@ -35,16 +19,10 @@ export function CallNavStatus() {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box direction="Column" shrink="No">
|
||||||
direction="Column"
|
<Line variant="Surface" size="300" />
|
||||||
style={{
|
<Box className={css.Actions} direction="Row" alignItems="Center" gap="100">
|
||||||
flexShrink: 0,
|
<Box className={css.RoomButtonWrap} grow="Yes">
|
||||||
borderTop: `${config.borderWidth.B300} solid ${color.Background.ContainerLine}`,
|
|
||||||
padding: `${config.space.S200} ${config.space.S200}`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box direction="Row" alignItems="Center" gap="100">
|
|
||||||
<Box grow="Yes" style={{ minWidth: 0 }}>
|
|
||||||
{hasActiveCall && (
|
{hasActiveCall && (
|
||||||
<TooltipProvider
|
<TooltipProvider
|
||||||
position="Top"
|
position="Top"
|
||||||
|
|
@ -57,22 +35,16 @@ export function CallNavStatus() {
|
||||||
>
|
>
|
||||||
{(triggerRef) => (
|
{(triggerRef) => (
|
||||||
<Chip
|
<Chip
|
||||||
variant="Background"
|
|
||||||
size="500"
|
size="500"
|
||||||
fill="Soft"
|
fill="Soft"
|
||||||
as="button"
|
as="button"
|
||||||
onClick={handleGoToCallRoom}
|
onClick={handleGoToCallRoom}
|
||||||
ref={triggerRef}
|
ref={triggerRef}
|
||||||
style={{
|
className={css.RoomButton}
|
||||||
width: '100%',
|
|
||||||
minWidth: 0,
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Icon size="200" src={Icons.VolumeHigh} />
|
<Icon size="300" src={Icons.VolumeHigh} />
|
||||||
<Text style={{ flexGrow: 1, minWidth: 0 }} size="B400" truncate>
|
<Text className={css.RoomName} size="B400" truncate>
|
||||||
{mx.getRoom(activeCallRoomId)?.name ?? ''}
|
{mx.getRoom(activeCallRoomId ?? '')?.name ?? ''}
|
||||||
</Text>
|
</Text>
|
||||||
</Chip>
|
</Chip>
|
||||||
)}
|
)}
|
||||||
|
|
@ -90,13 +62,7 @@ export function CallNavStatus() {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{(triggerRef) => (
|
{(triggerRef) => (
|
||||||
<IconButton
|
<IconButton fill="None" size="300" ref={triggerRef} onClick={hangUp}>
|
||||||
variant="Background"
|
|
||||||
size="400"
|
|
||||||
radii="400"
|
|
||||||
ref={triggerRef}
|
|
||||||
onClick={hangUp}
|
|
||||||
>
|
|
||||||
<Icon src={Icons.Phone} />
|
<Icon src={Icons.Phone} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -112,13 +78,7 @@ export function CallNavStatus() {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{(triggerRef) => (
|
{(triggerRef) => (
|
||||||
<IconButton
|
<IconButton fill="None" size="300" ref={triggerRef} onClick={toggleAudio}>
|
||||||
variant="Background"
|
|
||||||
size="400"
|
|
||||||
radii="400"
|
|
||||||
ref={triggerRef}
|
|
||||||
onClick={toggleAudio}
|
|
||||||
>
|
|
||||||
<Icon src={!isAudioEnabled ? Icons.MicMute : Icons.Mic} />
|
<Icon src={!isAudioEnabled ? Icons.MicMute : Icons.Mic} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -133,13 +93,7 @@ export function CallNavStatus() {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{(triggerRef) => (
|
{(triggerRef) => (
|
||||||
<IconButton
|
<IconButton fill="None" size="300" ref={triggerRef} onClick={toggleVideo}>
|
||||||
variant="Background"
|
|
||||||
size="400"
|
|
||||||
radii="400"
|
|
||||||
ref={triggerRef}
|
|
||||||
onClick={toggleVideo}
|
|
||||||
>
|
|
||||||
<Icon src={!isVideoEnabled ? Icons.VideoCameraMute : Icons.VideoCamera} />
|
<Icon src={!isVideoEnabled ? Icons.VideoCameraMute : Icons.VideoCamera} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue