From 6facf3b7a703f2119479202487db92d7e2657048 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Mon, 29 Aug 2022 00:00:58 -0500 Subject: [PATCH] sidebar ordering --- web/components/nav/sidebar.tsx | 14 +++++++------- web/components/sign-in-button.tsx | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 11051ea0..1b030098 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -20,7 +20,6 @@ import React from 'react' import { IS_PRIVATE_MANIFOLD } from 'common/envs/constants' import { CreateQuestionButton } from 'web/components/create-question-button' import { trackCallback, withTracking } from 'web/lib/service/analytics' -import { Spacer } from '../layout/spacer' import { CHALLENGES_ENABLED } from 'common/challenge' import { buildArray } from 'common/util/array' import TrophyIcon from 'web/lib/icons/trophy-icon' @@ -66,10 +65,10 @@ function getMoreNavigation(user?: User | null) { if (!user) { // Signed out "More" return buildArray( + { name: 'Leaderboards', href: '/leaderboards' }, + { name: 'Groups', href: '/groups' }, CHALLENGES_ENABLED && { name: 'Challenges', href: '/challenges' }, [ - { name: 'Groups', href: '/groups' }, - { name: 'Leaderboards', href: '/leaderboards' }, { name: 'Tournaments', href: '/tournaments' }, { name: 'Charity', href: '/charity' }, { name: 'Blog', href: 'https://news.manifold.markets' }, @@ -81,11 +80,11 @@ function getMoreNavigation(user?: User | null) { // Signed in "More" return buildArray( + { name: 'Leaderboards', href: '/leaderboards' }, + { name: 'Groups', href: '/groups' }, CHALLENGES_ENABLED && { name: 'Challenges', href: '/challenges' }, [ - { name: 'Groups', href: '/groups' }, { name: 'Referrals', href: '/referrals' }, - { name: 'Leaderboards', href: '/leaderboards' }, { name: 'Charity', href: '/charity' }, { name: 'Send M$', href: '/links' }, { name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' }, @@ -233,9 +232,8 @@ export default function Sidebar(props: { className?: string }) { > - {user ? : } + {!user && } - {user && (
@@ -265,6 +263,8 @@ export default function Sidebar(props: { className?: string }) { menuItems={getMoreNavigation(user)} buttonContent={} /> + + {user && }
) diff --git a/web/components/sign-in-button.tsx b/web/components/sign-in-button.tsx index 8378134f..48afb6c7 100644 --- a/web/components/sign-in-button.tsx +++ b/web/components/sign-in-button.tsx @@ -4,7 +4,7 @@ import { useRouter } from 'next/router' import { firebaseLogin } from 'web/lib/firebase/users' import { Button } from './button' -export const SignInButton = () => { +export const SignInButton = (props: { className?: string }) => { const router = useRouter() return ( @@ -17,6 +17,7 @@ export const SignInButton = () => { await firebaseLogin() router.replace(router.asPath) }} + className={props.className} > Sign in