diff --git a/web/components/ui/Content/MobileContent.tsx b/web/components/ui/Content/MobileContent.tsx index 2642d1642..91a50e8d3 100644 --- a/web/components/ui/Content/MobileContent.tsx +++ b/web/components/ui/Content/MobileContent.tsx @@ -54,6 +54,29 @@ const ChatContainer = dynamic( }, ); +type ChatContentProps = { + showChat: boolean; + chatEnabled: boolean; + messages: ChatMessage[]; + currentUser: CurrentUser; +}; + +const ChatContent: FC = ({ showChat, chatEnabled, messages, currentUser }) => { + const { id, displayName } = currentUser; + + return showChat && !!currentUser ? ( + + ) : ( + + ); +}; + export const MobileContent: FC = ({ name, summary, @@ -71,21 +94,6 @@ export const MobileContent: FC = ({ supportFediverseFeatures, supportsBrowserNotifications, }) => { - if (!currentUser) { - return ; - } - const { id, displayName } = currentUser; - - const chatContent = showChat && ( - - ); - const aboutTabContent = ( <> @@ -104,7 +112,18 @@ export const MobileContent: FC = ({ const items = []; if (showChat) { - items.push({ label: 'Chat', key: '0', children: chatContent }); + items.push({ + label: 'Chat', + key: '0', + children: ( + + ), + }); } items.push({ label: 'About', key: '2', children: aboutTabContent }); if (supportFediverseFeatures) {