From a053ea19b10ab047ac3f697bf48bc945ba6ff188 Mon Sep 17 00:00:00 2001 From: Michal Sapka Date: Sat, 6 Aug 2022 23:15:05 +0200 Subject: feat: responsive nav Taken from https://dev.to/dmuraco3/responsive-global-navbar-in-nextjs-with-tailwindcss-45p4 --- components/topnav.tsx | 61 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 14 deletions(-) (limited to 'components/topnav.tsx') diff --git a/components/topnav.tsx b/components/topnav.tsx index 70814b3..7daeeb5 100644 --- a/components/topnav.tsx +++ b/components/topnav.tsx @@ -1,17 +1,50 @@ -export default function TopNav() { - return( - <> -
-
- Michal Sapka +import { useState } from 'react' + +function NavLink({to, children}) { + return + {children} + +} + +function MobileNav({open, setOpen}) { + return ( +
+
+ setTimeout(() => {setOpen(!open)}, 100)}> + About + + setTimeout(() => {setOpen(!open)}, 100)}> + Contact + +
-
- - ) + ) } + -- cgit v1.2.3