Skip to content
Snippets Groups Projects
Commit 6ea70ac1 authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Fix sidebar width; Add way to change active item on sidebar

parent 7cf1d879
No related branches found
No related tags found
2 merge requests!7Merge develop to main,!2Draft: Add Compare Chart Feature
...@@ -4,9 +4,9 @@ import Link from "next/link"; ...@@ -4,9 +4,9 @@ import Link from "next/link";
import classNames from "classnames"; import classNames from "classnames";
import { ChartBarIcon, GlobeIcon } from "@heroicons/react/outline"; import { ChartBarIcon, GlobeIcon } from "@heroicons/react/outline";
function Sidebar() { function Sidebar({ active }) {
return ( return (
<div className="w-64 dark:text-white"> <div className="w-64 min-w-[16rem] dark:text-white">
{/* Sidebar Head */} {/* Sidebar Head */}
<span className="flex justify-center items-center mt-5" id="crypto-logo"> <span className="flex justify-center items-center mt-5" id="crypto-logo">
<Image <Image
...@@ -27,13 +27,13 @@ function Sidebar() { ...@@ -27,13 +27,13 @@ function Sidebar() {
title="Home" title="Home"
icon={<GlobeIcon className="w-6 h-6" />} icon={<GlobeIcon className="w-6 h-6" />}
to="/" to="/"
active={true} active={active === "home"}
/> />
<SidebarItem <SidebarItem
title="Compare" title="Compare"
icon={<ChartBarIcon className="w-6 h-6" />} icon={<ChartBarIcon className="w-6 h-6" />}
to="/map" to="/compare"
active={false} active={active === "compare"}
/> />
</nav> </nav>
</div> </div>
......
...@@ -47,7 +47,7 @@ export default function Home() { ...@@ -47,7 +47,7 @@ export default function Home() {
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
<Wrapper> <Wrapper>
<Sidebar /> <Sidebar active="home" />
<Main> <Main>
<Container> <Container>
{/* Header */} {/* Header */}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment