diff --git a/client/views/room/Header/Header.js b/client/views/room/Header/Header.js index 7cdd6c1001d4..9b664d5f68f9 100644 --- a/client/views/room/Header/Header.js +++ b/client/views/room/Header/Header.js @@ -12,14 +12,20 @@ import { useLayout } from '../../../contexts/LayoutContext'; import Burger from './Burger'; import MarkdownText from '../../../components/MarkdownText'; import { roomTypes } from '../../../../app/utils'; -import { useUserRoom } from '../../../contexts/UserContext'; +import { useUserRoom, useUserId } from '../../../contexts/UserContext'; +import { useUserData } from '../../../hooks/useUserData'; export default React.memo(({ room }) => { const { isEmbedded, showTopNavbarEmbeddedLayout } = useLayout(); if (isEmbedded && !showTopNavbarEmbeddedLayout) { return null; } - return ; + + if (room.t === 'd' && room.uids.length < 3) { + return ; + } + + return ; }); const HeaderIcon = ({ room }) => { @@ -47,8 +53,15 @@ const RoomTitle = ({ room }) => { ; }; +const DirectRoomHeader = ({ room }) => { + const userId = useUserId(); + const directUserId = room.uids.filter((uid) => uid !== userId).shift(); + const directUserData = useUserData(directUserId); + + return ; +}; -const RoomHeader = ({ room }) => { +const RoomHeader = ({ room, topic }) => { const { isMobile } = useLayout(); const avatar = ; @@ -65,7 +78,7 @@ const RoomHeader = ({ room }) => { - {room.topic && } + {topic && }