From 0430adc5020e9505c5077c359850b638fa028071 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 10 Sep 2022 12:08:22 -0700 Subject: [PATCH] Add mobile-specific tabs+content --- .../ContentHeader/ContentHeader.module.scss | 1 + web/components/ui/Content/Content.module.scss | 6 +- web/components/ui/Content/Content.tsx | 115 ++++++++++++++---- .../CustomPageContent.module.scss | 6 +- web/components/ui/Header/Header.tsx | 4 +- 5 files changed, 104 insertions(+), 28 deletions(-) diff --git a/web/components/common/ContentHeader/ContentHeader.module.scss b/web/components/common/ContentHeader/ContentHeader.module.scss index 676d09735..860e09fc3 100644 --- a/web/components/common/ContentHeader/ContentHeader.module.scss +++ b/web/components/common/ContentHeader/ContentHeader.module.scss @@ -39,6 +39,7 @@ font-weight: 300; line-height: 1.3; color: var(--theme-color-background-header); + max-width: 900px; } } diff --git a/web/components/ui/Content/Content.module.scss b/web/components/ui/Content/Content.module.scss index ea527ac97..8c527e09a 100644 --- a/web/components/ui/Content/Content.module.scss +++ b/web/components/ui/Content/Content.module.scss @@ -9,9 +9,13 @@ background-color: var(--theme-color-components-video-background); } .lowerSection { - padding: 0em 2em; + padding: 0em 2%; margin-bottom: 2em; } + + .lowerSectionMobile { + padding: 0.3em; + } } .leftCol { diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx index 1eb9b541e..96a9a62ba 100644 --- a/web/components/ui/Content/Content.tsx +++ b/web/components/ui/Content/Content.tsx @@ -1,10 +1,14 @@ import { useRecoilState, useRecoilValue } from 'recoil'; import { Layout, Tabs, Spin } from 'antd'; import { FC, useEffect, useState } from 'react'; +import classNames from 'classnames'; import { LOCAL_STORAGE_KEYS, getLocalStorage, setLocalStorage } from '../../../utils/localStorage'; import { clientConfigStateAtom, + chatMessagesAtom, + chatDisplayNameAtom, + chatUserIdAtom, isChatVisibleSelector, appStateAtom, isOnlineSelector, @@ -31,19 +35,87 @@ import { BrowserNotifyModal } from '../../modals/BrowserNotifyModal/BrowserNotif import { ContentHeader } from '../../common/ContentHeader/ContentHeader'; import { ServerStatus } from '../../../interfaces/server-status.model'; import { Statusbar } from '../Statusbar/Statusbar'; +import { ChatContainer } from '../../chat/ChatContainer/ChatContainer'; +import { ChatMessage } from '../../../interfaces/chat-message.model'; const { TabPane } = Tabs; const { Content: AntContent } = Layout; +const DesktopContent = ({ name, streamTitle, summary, tags, socialHandles, extraPageContent }) => ( + <> +
+ +
+ +
+ + + + + + + + +
+ +); + +const MobileContent = ({ + name, + streamTitle, + summary, + tags, + socialHandles, + extraPageContent, + messages, + chatDisplayName, + chatUserId, +}) => ( +
+ + + {' '} + + + + + + + + + +
+); + export const Content: FC = () => { const appState = useRecoilValue(appStateAtom); const clientConfig = useRecoilValue(clientConfigStateAtom); const isChatVisible = useRecoilValue(isChatVisibleSelector); const [isMobile, setIsMobile] = useRecoilState(isMobileAtom); - // const messages = useRecoilValue(chatMessagesAtom); + const messages = useRecoilValue(chatMessagesAtom); const online = useRecoilValue(isOnlineSelector); - // const chatDisplayName = useRecoilValue(chatDisplayNameAtom); - // const chatUserId = useRecoilValue(chatUserIdAtom); + const chatDisplayName = useRecoilValue(chatDisplayNameAtom); + const chatUserId = useRecoilValue(chatUserIdAtom); const { viewerCount, lastConnectTime, lastDisconnectTime, streamTitle } = useRecoilValue(serverStatusState); const { @@ -145,31 +217,32 @@ export const Content: FC = () => { -
- -
- -
- - - - - - - - -
+ ) : ( + + )} {isChatVisible && !isMobile && } -