diff --git a/web/components/page.tsx b/web/components/page.tsx index e76a4dc2..40cbf7f7 100644 --- a/web/components/page.tsx +++ b/web/components/page.tsx @@ -8,9 +8,11 @@ export function Page(props: { rightSidebar?: ReactNode suspend?: boolean className?: string + rightSidebarClassName?: string children?: ReactNode }) { - const { children, rightSidebar, suspend, className } = props + const { children, rightSidebar, suspend, className, rightSidebarClassName } = + props const bottomBarPadding = 'pb-[58px] lg:pb-0 ' return ( @@ -37,7 +39,11 @@ export function Page(props: {
{rightSidebar}
diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index df1c7e2f..c914b7f0 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -52,8 +52,8 @@ import { FollowList } from 'web/components/follow-list' import { SearchIcon } from '@heroicons/react/outline' import { useTipTxns } from 'web/hooks/use-tip-txns' import { JoinOrLeaveGroupButton } from 'web/components/groups/groups-button' -import { OnlineUserList } from 'web/components/online-user-list' import { searchInAny } from 'common/util/parse' +import { useWindowSize } from 'web/hooks/use-window-size' export const getStaticProps = fromPropz(getStaticPropz) export async function getStaticPropz(props: { params: { slugs: string[] } }) { @@ -164,6 +164,9 @@ export default function GroupPage(props: { writeReferralInfo(creator.username, undefined, referrer, group?.slug) }, [user, creator, group, router]) + const { width } = useWindowSize() + const showChatSidebar = (width ?? 1280) >= 1280 + if (group === null || !groupSubpages.includes(page) || slugs[2]) { return } @@ -171,16 +174,6 @@ export default function GroupPage(props: { const isCreator = user && group && user.id === group.creatorId const isMember = user && memberIds.includes(user.id) - const rightSidebar = ( - - - {/* */} - - ) const leaderboard = ( ) + const chatTab = group.chatDisabled ? ( + <> + ) : ( + + {messages ? ( + + ) : ( + + )} + + ) + const tabs = [ - ...(group.chatDisabled + ...(group.chatDisabled || showChatSidebar ? [] : [ { title: 'Chat', - content: messages ? ( - - ) : ( - - ), + content: chatTab, href: groupPath(group.slug, GROUP_CHAT_SLUG), }, ]), @@ -251,8 +247,13 @@ export default function GroupPage(props: { }, ] const tabIndex = tabs.map((t) => t.title).indexOf(page ?? GROUP_CHAT_SLUG) + return ( - +