From e504a9ef4ce6e8ec04f23b7f56e567cd2dba3d48 Mon Sep 17 00:00:00 2001 From: Gimle Larpes Date: Thu, 31 Jul 2025 20:52:01 +0200 Subject: [PATCH] Update RoomView.tsx to accomodate restructuring of Room, RoomView and CallView --- src/app/features/room/RoomView.tsx | 116 ++++++++++++++++------------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/src/app/features/room/RoomView.tsx b/src/app/features/room/RoomView.tsx index 25d8fbd8..dd3c5e64 100644 --- a/src/app/features/room/RoomView.tsx +++ b/src/app/features/room/RoomView.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useRef } from 'react'; -import { Box, Text, config } from 'folds'; // Assuming 'folds' is a UI library +import { Box, Text, config, toRem } from 'folds'; import { EventType, Room } from 'matrix-js-sdk'; import { ReactEditor } from 'slate-react'; import { isKeyHotkey } from 'is-hotkey'; @@ -15,7 +15,6 @@ import { RoomTombstone } from './RoomTombstone'; import { RoomInput } from './RoomInput'; import { RoomViewFollowing, RoomViewFollowingPlaceholder } from './RoomViewFollowing'; import { Page } from '../../components/page'; -import { RoomViewHeader } from './RoomViewHeader'; import { useKeyDown } from '../../hooks/useKeyDown'; import { editableActiveElement } from '../../utils/dom'; import navigation from '../../../client/state/navigation'; @@ -23,6 +22,8 @@ import { settingsAtom } from '../../state/settings'; import { useSetting } from '../../state/hooks/settings'; import { useAccessibleTagColors, usePowerLevelTags } from '../../hooks/usePowerLevelTags'; import { useTheme } from '../../hooks/useTheme'; +import { useCallState } from '../../pages/client/call/CallProvider'; +import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize'; const FN_KEYS_REGEX = /^F\d+$/; @@ -64,6 +65,8 @@ export function RoomView({ room, eventId }: { room: Room; eventId?: string }) { const roomInputRef = useRef(null); const roomViewRef = useRef(null); const [hideActivity] = useSetting(settingsAtom, 'hideActivity'); + const screenSize = useScreenSizeContext(); + const { isChatOpen } = useCallState(); const { roomId } = room; const editor = useEditor(); const mx = useMatrixClient(); @@ -98,55 +101,64 @@ export function RoomView({ room, eventId }: { room: Room; eventId?: string }) { ); return ( - - {!room.isCallRoom() && } - - - - - -
- {' '} - {tombstoneEvent ? ( - - ) : ( - <> - {canMessage ? ( - - ) : ( - - You do not have permission to post in this room - - )} - - )} -
- {hideActivity ? : } -
-
+ (!room.isCallRoom() || isChatOpen) && ( + + + + + + +
+ {' '} + {tombstoneEvent ? ( + + ) : ( + /* eslint-disable-next-line react/jsx-no-useless-fragment */ + <> + {canMessage ? ( + + ) : ( + + You do not have permission to post in this room + + )} + + )} +
+ {hideActivity ? : } +
+
+ ) ); }