From 50ab6dc6de52c281e052b475acef5f2e9a80ce21 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 17 Mar 2022 10:03:30 -0700 Subject: [PATCH] Hook up sidebar options to the current page --- web/components/nav/sidebar.tsx | 58 ++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 23d90f19..0352ac2c 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -3,14 +3,19 @@ import { FireIcon, UserGroupIcon, TrendingUpIcon, + SearchIcon, + CollectionIcon, } from '@heroicons/react/outline' import clsx from 'clsx' +import Link from 'next/link' +import { useRouter } from 'next/router' const navigation = [ - { name: 'Home', href: '#', icon: HomeIcon, current: true }, - { name: 'Popular', href: '#', icon: FireIcon, current: false }, - { name: 'Communities', href: '#', icon: UserGroupIcon, current: false }, - { name: 'Trending', href: '#', icon: TrendingUpIcon, current: false }, + { name: 'Home', href: '/home', icon: HomeIcon }, + { name: 'Markets', href: '/markets', icon: SearchIcon }, + { name: 'Communities', href: '/folds', icon: UserGroupIcon }, + { name: 'Trades', href: '/trades', icon: CollectionIcon }, + // { name: 'Trending', href: '#', icon: TrendingUpIcon, current: false }, ] const communities = [ @@ -25,32 +30,37 @@ const communities = [ ] export default function Sidebar() { + const router = useRouter() + const currentPage = router.pathname + return (