This commit is contained in:
github-actions[bot] 2022-10-11 21:06:19 +00:00 committed by GitHub
commit d067a534bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,10 +99,10 @@ export async function getStaticPaths() {
const groupSubpages = [ const groupSubpages = [
undefined, undefined,
GROUP_CHAT_SLUG, GROUP_CHAT_SLUG,
'overview',
'markets', 'markets',
'leaderboards', 'leaderboards',
'about', 'about',
'posts',
] as const ] as const
export default function GroupPage(props: { export default function GroupPage(props: {
@ -131,8 +131,8 @@ export default function GroupPage(props: {
const router = useRouter() const router = useRouter()
const { slugs } = router.query as { slugs: string[] } const { slugs } = router.query as { slugs: string[] }
const page = slugs?.[1] as typeof groupSubpages[number] const page = slugs?.[1] as typeof groupSubpages[number]
const tabIndex = ['markets', 'leaderboard', 'about', 'posts'].indexOf( const tabIndex = ['overview', 'markets', 'leaderboards'].indexOf(
page ?? 'markets' page === 'about' ? 'overview' : page ?? 'markets'
) )
const group = useGroup(props.group?.id) ?? props.group const group = useGroup(props.group?.id) ?? props.group