mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 07:20:29 +03:00
Update room to use CallView
This commit is contained in:
parent
8b50ac150b
commit
43ce6f0210
1 changed files with 32 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ import { useKeyDown } from '../../hooks/useKeyDown';
|
||||||
import { markAsRead } from '../../../client/action/notifications';
|
import { markAsRead } from '../../../client/action/notifications';
|
||||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||||
import { useRoomMembers } from '../../hooks/useRoomMembers';
|
import { useRoomMembers } from '../../hooks/useRoomMembers';
|
||||||
|
import { CallView } from './CallView';
|
||||||
|
|
||||||
export function Room() {
|
export function Room() {
|
||||||
const { eventId } = useParams();
|
const { eventId } = useParams();
|
||||||
|
|
@ -23,7 +24,7 @@ export function Room() {
|
||||||
const [hideActivity] = useSetting(settingsAtom, 'hideActivity');
|
const [hideActivity] = useSetting(settingsAtom, 'hideActivity');
|
||||||
const screenSize = useScreenSizeContext();
|
const screenSize = useScreenSizeContext();
|
||||||
const powerLevels = usePowerLevels(room);
|
const powerLevels = usePowerLevels(room);
|
||||||
const members = useRoomMembers(mx, room.roomId);
|
const members = useRoomMembers(mx, room?.roomId);
|
||||||
|
|
||||||
useKeyDown(
|
useKeyDown(
|
||||||
window,
|
window,
|
||||||
|
|
@ -39,14 +40,36 @@ export function Room() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PowerLevelsContextProvider value={powerLevels}>
|
<PowerLevelsContextProvider value={powerLevels}>
|
||||||
<Box grow="Yes">
|
<Box
|
||||||
<RoomView room={room} eventId={eventId} />
|
grow="Yes"
|
||||||
{screenSize === ScreenSize.Desktop && isDrawer && (
|
style={{
|
||||||
<>
|
width: '100%',
|
||||||
<Line variant="Background" direction="Vertical" size="300" />
|
height: '100%',
|
||||||
<MembersDrawer key={room.roomId} room={room} members={members} />
|
display: 'flex',
|
||||||
</>
|
flexDirection: 'row',
|
||||||
)}
|
}}
|
||||||
|
>
|
||||||
|
<CallView room={room} eventId={eventId} />
|
||||||
|
|
||||||
|
<Box
|
||||||
|
grow="Yes"
|
||||||
|
style={{
|
||||||
|
width: room.isCallRoom() ? '50%' : '100%',
|
||||||
|
height: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box style={{ flex: 1, minHeight: 0, overflowY: 'auto', background: '#fff' }}>
|
||||||
|
<RoomView room={room} eventId={eventId} />
|
||||||
|
</Box>
|
||||||
|
{screenSize === ScreenSize.Desktop && isDrawer && (
|
||||||
|
<>
|
||||||
|
<Line variant="Background" direction="Vertical" size="300" />
|
||||||
|
<MembersDrawer key={room.roomId} room={room} members={members} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</PowerLevelsContextProvider>
|
</PowerLevelsContextProvider>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue