From 2431930b76688cf14c99e08bbbceee7779dfb405 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:09:51 -0500 Subject: [PATCH] feat: implement toggler for right side nav --- src/app/components/NavBar.module.css | 60 ++++++++++++++++++++++++- src/app/components/NavBar.tsx | 65 +++++++++++++++++++--------- 2 files changed, 103 insertions(+), 22 deletions(-) diff --git a/src/app/components/NavBar.module.css b/src/app/components/NavBar.module.css index 99a78c0..7c79e0b 100644 --- a/src/app/components/NavBar.module.css +++ b/src/app/components/NavBar.module.css @@ -8,9 +8,13 @@ margin: 0 auto; } -.navList { +.navListRight, +.navListLeft { display: flex; list-style: none; +} + +.navListRight { padding: 0 1rem 0 0; } @@ -91,4 +95,58 @@ cursor: pointer; font-weight: bold; margin: 1rem; +} + +.navbarToggle { + cursor: pointer; + display: none; +} + +.navbarToggleLine { + width: 2rem; + height: 0.25rem; + background-color: #64adac; + margin: 2px; + border-radius: 0.25rem; +} + +@media screen and (max-width: 1000px) { + .nav { + align-items: flex-start; + box-shadow: 0 2px 5px 0 rgba(59, 65, 94, .1); + } + + .navbarToggle { + display: flex; + flex-direction: column; + align-items: flex-end; + padding: 0 1rem 0 0; + } + + .navListRight { + display: none; + } + + .navListRightOpen { + margin-top: 1rem; + display: flex; + flex-direction: column; + } + + .dropdownMenuOpen { + position: static; + display: block; + padding: 0; + padding-left: 0.5rem; + z-index: 0; + box-shadow: none; + border-radius: 0; + background-color: transparent; + white-space: nowrap; + transform: none; + } + + .dropdownMenuOpen::before { + content: none; + } } \ No newline at end of file diff --git a/src/app/components/NavBar.tsx b/src/app/components/NavBar.tsx index e8dfd39..48ea0da 100644 --- a/src/app/components/NavBar.tsx +++ b/src/app/components/NavBar.tsx @@ -153,38 +153,61 @@ export default function NavBar({ }: { version: DocsStructure; }) { + const [isNavOpen, setIsNavOpen] = + useState(false); + + const handleNavToggle = () => { + setIsNavOpen(!isNavOpen); + }; + return ( ); }