11import { useState } from "react" ;
22
33export default function Navbar ( ) {
4- // Controla se o menu mobile está aberto ou fechado
54 const [ isOpen , setIsOpen ] = useState ( false ) ;
65
76 return (
@@ -11,43 +10,66 @@ export default function Navbar() {
1110 < div className = "w-2 h-2 bg-primary rounded-full" > </ div >
1211 < span > OrderFlow</ span >
1312 </ div >
14-
15- { /* Botão hambúrguer (lado direito, só aparece no mobile) */ }
1613 < button
1714 onClick = { ( ) => setIsOpen ( ! isOpen ) }
1815 className = "md:hidden p-2 rounded-md hover:bg-gray-100"
1916 aria-label = "Abrir menu"
2017 >
21- { /* Troca o ícone dependendo do estado */ }
2218 { isOpen ? (
23- // Ícone X (fechar)
24- < svg className = "w-5 h-5" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
25- < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = { 2 } d = "M6 18L18 6M6 6l12 12" />
19+ < svg
20+ className = "w-5 h-5"
21+ fill = "none"
22+ stroke = "currentColor"
23+ viewBox = "0 0 24 24"
24+ >
25+ < path
26+ strokeLinecap = "round"
27+ strokeLinejoin = "round"
28+ strokeWidth = { 2 }
29+ d = "M6 18L18 6M6 6l12 12"
30+ />
2631 </ svg >
2732 ) : (
28- // Ícone hambúrguer (3 linhas)
29- < svg className = "w-5 h-5" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
30- < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = { 2 } d = "M4 6h16M4 12h16M4 18h16" />
33+ < svg
34+ className = "w-5 h-5"
35+ fill = "none"
36+ stroke = "currentColor"
37+ viewBox = "0 0 24 24"
38+ >
39+ < path
40+ strokeLinecap = "round"
41+ strokeLinejoin = "round"
42+ strokeWidth = { 2 }
43+ d = "M4 6h16M4 12h16M4 18h16"
44+ />
3145 </ svg >
3246 ) }
3347 </ button >
34-
35- { /* Links no desktop (some no mobile) */ }
3648 < div className = "hidden md:flex items-center gap-4" >
37- < a href = "#" className = "hover:text-primary" > Início</ a >
38- < a href = "#" className = "hover:text-primary" > Pedidos</ a >
39- < a href = "#" className = "hover:text-primary" > Configurações</ a >
49+ < a href = "#" className = "hover:text-primary" >
50+ Início
51+ </ a >
52+ < a href = "#" className = "hover:text-primary" >
53+ Pedidos
54+ </ a >
55+ < a href = "#" className = "hover:text-primary" >
56+ Configurações
57+ </ a >
4058 </ div >
4159 </ div >
42-
43- { /* Menu mobile — só aparece quando isOpen for true */ }
4460 { isOpen && (
4561 < div className = "md:hidden flex flex-col px-4 pb-4 gap-3 border-t border-border" >
46- < a href = "/" className = "hover:text-primary" > Produtos</ a >
47- < a href = "/checkout" className = "hover:text-primary" > Checkout</ a >
48- < a href = "/email-confirm" className = "hover:text-primary" > Pedido</ a >
62+ < a href = "/" className = "hover:text-primary" >
63+ Produtos
64+ </ a >
65+ < a href = "/checkout" className = "hover:text-primary" >
66+ Checkout
67+ </ a >
68+ < a href = "/email-confirm" className = "hover:text-primary" >
69+ Pedido
70+ </ a >
4971 </ div >
5072 ) }
5173 </ nav >
5274 ) ;
53- }
75+ }
0 commit comments