diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index caa08314..d201842d 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -148,20 +148,11 @@ export default function GroupPage(props: { const rightSidebar = ( - - + + {contracts && (
-
Recent Questions
+
Recent Questions
b.createdTime - a.createdTime) @@ -175,15 +166,24 @@ export default function GroupPage(props: { ) - const leaderboardsTab = ( - - + + + + + ) return ( @@ -194,27 +194,24 @@ export default function GroupPage(props: { url={groupPath(group.slug)} /> -
- + +
- <span className={'hidden text-gray-700 sm:block'}> - {group.about} - </span> + <Linkify text={group.about} /> </div> - {isMember && ( - <CreateQuestionButton + <div className="hidden sm:block xl:hidden"> + <JoinOrCreateButton + group={group} user={user} - overrideText={'Add a new question'} - className={'w-48 flex-shrink-0'} - query={`?groupId=${group.id}`} + isMember={!!isMember} /> - )} - {!isMember && group.anyoneCanJoin && ( - <JoinGroupButton group={group} user={user} /> - )} + </div> </Row> - </div> + <div className="block sm:hidden"> + <JoinOrCreateButton group={group} user={user} isMember={!!isMember} /> + </div> + </Col> <Tabs defaultIndex={page === 'details' ? 2 : page === 'questions' ? 1 : 0} @@ -262,24 +259,7 @@ export default function GroupPage(props: { }, { title: 'Details', - content: ( - <> - <div className={'xl:hidden'}> - <GroupOverview - group={group} - creator={creator} - isCreator={!!isCreator} - user={user} - /> - <YourPerformance - traderScores={traderScores} - creatorScores={creatorScores} - user={user} - /> - </div> - {leaderboardsTab} - </> - ), + content: detailsTab, href: groupPath(group.slug, 'details'), }, ]} @@ -288,6 +268,24 @@ export default function GroupPage(props: { ) } +function JoinOrCreateButton(props: { + group: Group + user: User | null | undefined + isMember: boolean +}) { + const { group, user, isMember } = props + return isMember ? ( + <CreateQuestionButton + user={user} + overrideText={'Add a new question'} + className={'w-48 flex-shrink-0'} + query={`?groupId=${group.id}`} + /> + ) : group.anyoneCanJoin ? ( + <JoinGroupButton group={group} user={user} /> + ) : null +} + function GroupOverview(props: { group: Group creator: User