From d7b702fe0067bfe0dd202709e54ad347caf3b579 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 3 Apr 2022 15:48:25 -0500 Subject: [PATCH] Portfolio page! Add to sidebar when signed in, move about into more. --- web/components/nav/profile-menu.tsx | 2 +- web/components/nav/sidebar.tsx | 11 ++++++++++- web/pages/portfolio.tsx | 24 ++++++++++++++++++++++++ web/pages/trades.tsx | 23 ++++++++--------------- web/public/sitemap-0.xml | 2 +- 5 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 web/pages/portfolio.tsx diff --git a/web/components/nav/profile-menu.tsx b/web/components/nav/profile-menu.tsx index 990c12bc..01a8fb14 100644 --- a/web/components/nav/profile-menu.tsx +++ b/web/components/nav/profile-menu.tsx @@ -17,10 +17,10 @@ export function getNavigationOptions(user?: User | null) { } return [ - { name: 'Your trades', href: '/trades' }, { name: 'Add funds', href: '/add-funds' }, { name: 'Leaderboards', href: '/leaderboards' }, { name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' }, + { name: 'About', href: 'https://docs.manifold.markets' }, { name: 'Sign out', href: '#', onClick: () => firebaseLogout() }, ] } diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index d40873da..2212475c 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -3,6 +3,7 @@ import { UserGroupIcon, SearchIcon, BookOpenIcon, + TableIcon, DotsHorizontalIcon, } from '@heroicons/react/outline' import clsx from 'clsx' @@ -17,6 +18,12 @@ import { MenuButton } from './menu' import { getNavigationOptions, ProfileSummary } from './profile-menu' const navigation = [ + { name: 'Home', href: '/home', icon: HomeIcon }, + { name: 'Markets', href: '/markets', icon: SearchIcon }, + { name: 'Portfolio', href: '/portfolio', icon: TableIcon }, +] + +const signedOutNavigation = [ { name: 'Home', href: '/home', icon: HomeIcon }, { name: 'Markets', href: '/markets', icon: SearchIcon }, { name: 'About', href: 'https://docs.manifold.markets', icon: BookOpenIcon }, @@ -76,6 +83,8 @@ export default function Sidebar() { let folds = useFollowedFolds(user) || [] folds = _.sortBy(folds, 'followCount').reverse() + const navigationOptions = user === null ? signedOutNavigation : navigation + return (