Rearrange nav, add Rules link, singular leaderboard

This commit is contained in:
James Grugett 2022-08-12 12:37:15 -05:00
parent a266de380f
commit e4a2f8acbb
2 changed files with 38 additions and 13 deletions

View File

@ -7,6 +7,7 @@ import {
HeartIcon,
TrendingUpIcon,
ChatIcon,
ExternalLinkIcon,
} from '@heroicons/react/outline'
import clsx from 'clsx'
import Link from 'next/link'
@ -40,7 +41,7 @@ function getNavigation() {
icon: NotificationsIcon,
},
{ name: 'Leaderboards', href: '/leaderboards', icon: TrendingUpIcon },
{ name: 'Leaderboard', href: '/leaderboards', icon: TrendingUpIcon },
...(IS_PRIVATE_MANIFOLD
? []
@ -51,6 +52,10 @@ function getNavigation() {
function getMoreNavigation(user?: User | null) {
if (IS_PRIVATE_MANIFOLD) {
return [
{
name: 'Rules',
href: 'https://www.cspicenter.com/p/introducing-the-salemcspi-forecasting',
},
{ name: 'Discord', href: 'https://discord.gg/ZtT7PxapSS' },
{ name: 'Manifold Markets', href: 'https://manifold.markets' },
{
@ -115,13 +120,22 @@ const signedOutNavigation = [
const signedOutMobileNavigation = IS_PRIVATE_MANIFOLD
? [
{ name: 'Leaderboards', href: '/leaderboards', icon: TrendingUpIcon },
{ name: 'Leaderboard', href: '/leaderboards', icon: TrendingUpIcon },
{
name: 'Rules',
href: 'https://www.cspicenter.com/p/introducing-the-salemcspi-forecasting',
icon: BookOpenIcon,
},
{
name: 'Discord',
href: 'https://discord.gg/ZtT7PxapSS',
icon: ChatIcon,
},
{
name: 'Manifold Markets',
href: 'https://manifold.markets',
icon: ExternalLinkIcon,
},
]
: [
{ name: 'Charity', href: '/charity', icon: HeartIcon },
@ -134,9 +148,25 @@ const signedOutMobileNavigation = IS_PRIVATE_MANIFOLD
]
const signedInMobileNavigation = [
{ name: 'Leaderboards', href: '/leaderboards', icon: TrendingUpIcon },
{ name: 'Leaderboard', href: '/leaderboards', icon: TrendingUpIcon },
...(IS_PRIVATE_MANIFOLD
? []
? [
{
name: 'Rules',
href: 'https://www.cspicenter.com/p/introducing-the-salemcspi-forecasting',
icon: BookOpenIcon,
},
{
name: 'Discord',
href: 'https://discord.gg/ZtT7PxapSS',
icon: ChatIcon,
},
{
name: 'Manifold Markets',
href: 'https://manifold.markets',
icon: ExternalLinkIcon,
},
]
: [
{ name: 'Get M$', href: '/add-funds', icon: CashIcon },
{
@ -150,10 +180,7 @@ const signedInMobileNavigation = [
function getMoreMobileNav() {
return [
...(IS_PRIVATE_MANIFOLD
? [
{ name: 'Manifold Markets', href: 'https://manifold.markets' },
{ name: 'Discord', href: 'https://discord.gg/ZtT7PxapSS' },
]
? []
: CHALLENGES_ENABLED
? [
{ name: 'Challenges', href: '/challenges' },

View File

@ -3,7 +3,6 @@ import { Leaderboard } from 'web/components/leaderboard'
import { Page } from 'web/components/page'
import { User, getFirstDayProfit, listAllUsers } from 'web/lib/firebase/users'
import { useEffect, useState } from 'react'
import { Title } from 'web/components/title'
import { useTracking } from 'web/hooks/use-tracking'
import { SEO } from 'web/components/SEO'
import { sortBy } from 'lodash'
@ -60,11 +59,10 @@ export default function Leaderboards(_props: { topTraders: User[] }) {
return (
<Page>
<SEO
title="Leaderboards"
description="Manifold's leaderboards show the top traders and market creators."
title="Leaderboard"
description="See the top traders of the CSPI/Salem Center Tournament."
url="/leaderboards"
/>
<Title text={'Leaderboards'} className={'hidden md:block'} />
<Col className="mx-4 max-w-sm items-center gap-10 lg:flex-row">
<Leaderboard