@@ -2,9 +2,16 @@ import styles from "../styles/Navbar.module.css";
2
2
import Aos from "aos" ;
3
3
import "aos/dist/aos.css" ;
4
4
import { useEffect , useState } from 'react'
5
- import { Link } from '@chakra-ui/react' ;
5
+ import { Drawer , DrawerBody , DrawerContent , DrawerHeader , DrawerOverlay , Link , useDisclosure } from '@chakra-ui/react' ;
6
+ import { FaBars } from "react-icons/fa" ;
7
+ import { useRouter } from "next/router" ;
6
8
7
9
export default function Navbar ( ) {
10
+
11
+ const { isOpen, onOpen, onClose } = useDisclosure ( )
12
+ const [ placement , setPlacement ] = useState ( 'bottom' )
13
+ const router = useRouter ( ) ;
14
+
8
15
useEffect ( ( ) => {
9
16
Aos . init ( { duration : 2000 } )
10
17
} )
@@ -31,11 +38,29 @@ export default function Navbar() {
31
38
< form autoComplete = "off" className = { styles . form } >
32
39
< Link href = "/" className = { styles . sign } > Home</ Link >
33
40
< Link href = "courses" className = { styles . sign } > Courses</ Link >
34
- < Link href = " signin" className = { styles . sign } > Signin</ Link >
35
- < Link href = " signup" className = { styles . sign } > Signup</ Link >
41
+ < Link onClick = { ( ) => router . push ( "/ signin") } className = { styles . sign } > Signin</ Link >
42
+ < Link onClick = { ( ) => router . push ( "/ signup") } className = { styles . sign } > Signup</ Link >
36
43
< Link href = "dashboard" className = { styles . sign } > Dashboard</ Link >
37
44
< Link href = "cart" className = { styles . sign } > Cart</ Link >
38
45
46
+ { /* drawer */ }
47
+ < FaBars onClick = { onOpen } className = { styles . bar } />
48
+ < Drawer placement = { placement } onClose = { onClose } isOpen = { isOpen } >
49
+ < DrawerOverlay />
50
+ < DrawerContent >
51
+
52
+ < DrawerBody className = { styles . draw } >
53
+
54
+ < Link href = "/" > < p > Home</ p > </ Link >
55
+ < Link href = "courses" > < p > Courses</ p > </ Link >
56
+ < Link onClick = { ( ) => router . push ( "/signin" ) } > < p > Signin</ p > </ Link >
57
+ < Link onClick = { ( ) => router . push ( "/signup" ) } > < p > Signup</ p > </ Link >
58
+ < Link href = "dashboard" > < p > Dashboard</ p > </ Link >
59
+ < Link href = "cart" > < p > Cart</ p > </ Link >
60
+ </ DrawerBody >
61
+ </ DrawerContent >
62
+ </ Drawer >
63
+
39
64
</ form >
40
65
41
66
</ div >
0 commit comments