-
+
)
- const sidebarPages = [
+ const tabs = [
{
title: 'Markets',
- content: questionsPage,
- href: groupPath(group.slug, 'markets'),
- key: 'markets',
+ content: questionsTab,
},
{
title: 'Leaderboards',
- content: leaderboardPage,
- href: groupPath(group.slug, 'leaderboards'),
- key: 'leaderboards',
+ content: leaderboardTab,
},
{
title: 'About',
- content: aboutPage,
- href: groupPath(group.slug, 'about'),
- key: 'about',
+ content: aboutTab,
},
]
- const pageContent = sidebarPages[sidebarIndex].content
- const onSidebarClick = (key: string) => {
- const index = sidebarPages.findIndex((t) => t.key === key)
- setSidebarIndex(index)
- // Append the page to the URL, e.g. /group/mexifold/markets
- router.replace(
- { query: { ...router.query, slugs: [group.slug, key] } },
- undefined,
- { shallow: true }
- )
- }
-
- const joinOrAddQuestionsButton = (
-
- )
-
return (
- <>
-
+
-
-
-
-
-
-
-
- {pageContent}
-
-
+
+
+
- >
+
)
}
-export function TopGroupNavBar(props: {
- group: Group
- currentPage: string
- onClick: (key: string) => void
-}) {
+export function TopGroupNavBar(props: { group: Group }) {
return (
-
)
}
@@ -330,7 +279,7 @@ function JoinOrAddQuestionsButtons(props: {
}) {
const { group, user, isMember } = props
return user && isMember ? (
-
+
) : group.anyoneCanJoin ? (