From 79d7a0cf28095d28e5a31ac03ddc4bc2d351588f Mon Sep 17 00:00:00 2001 From: Michal Sapka Date: Tue, 9 Aug 2022 23:50:59 +0200 Subject: feat: basic responsive nav --- components/topnav.tsx | 91 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 37 deletions(-) (limited to 'components/topnav.tsx') diff --git a/components/topnav.tsx b/components/topnav.tsx index 7daeeb5..e67f603 100644 --- a/components/topnav.tsx +++ b/components/topnav.tsx @@ -1,4 +1,22 @@ import { useState } from 'react' +import { + Link, + Box, + HStack, + IconButton, + Menu, + Heading, + MenuButton, + MenuList, + MenuItem, + MenuItemOption, + MenuGroup, + MenuOptionGroup, + MenuDivider, + useMediaQuery, +} from '@chakra-ui/react' +import { GiHamburgerMenu } from "react-icons/gi" +import { DiGithubBadge } from "react-icons/di" function NavLink({to, children}) { return @@ -6,45 +24,44 @@ function NavLink({to, children}) { } -function MobileNav({open, setOpen}) { - return ( -
-
- setTimeout(() => {setOpen(!open)}, 100)}> - About - - setTimeout(() => {setOpen(!open)}, 100)}> - Contact - -
-
- ) +function MobileNav() { + return + }> + Action + + + Publications + }>View source + + } -export default function Navbar() { +function DesktopNav() { + return + + Publications + + + Source code + + +} + +function Navigation() { + const [isMobile] = useMediaQuery("(max-width: 768px)") + + let navigationComponent = isMobile ? MobileNav : DesktopNav - const [open, setOpen] = useState(false) - return ( - - ) + + return {navigationComponent()} } +export default function Navbar() { + + return + Michal + + +} + + -- cgit v1.2.3