@@ -12,7 +12,7 @@ export type SidebarItem = {
1212
1313const items : SidebarItem [ ] = [
1414 { label : 'Dados de cadastro' , icon : < User /> , key : 'user' } ,
15- { label : 'Minhas bases ' , icon : < BrainCircuit /> , key : 'bases' } ,
15+ { label : 'Bases ' , icon : < BrainCircuit /> , key : 'bases' } ,
1616 { label : 'Assinatura' , icon : < Wallet /> , key : 'subscription' }
1717]
1818
@@ -45,58 +45,96 @@ export function Sidebar() {
4545 }
4646
4747 return (
48- < motion . aside
49- className = { `bg-background fixed z-10 flex h-full flex-col justify-between border-r-[1px] border-gray-100/20 px-4 py-8 pt-24 transition-all duration-300 ${
50- isCollapsed ? 'w-20' : 'w-96'
51- } `}
52- initial = "hidden"
53- whileInView = "visible"
54- transition = { { staggerChildren : 0.04 } }
55- >
56- { /* Botão para toggle da sidebar */ }
57- < div className = "flex flex-col justify-center gap-4" >
58- < motion . div transition = { transition } variants = { variants } >
59- < Button
60- variant = "ghost"
61- className = "hover:bg-muted/50 text-foreground self-start"
62- onClick = { toggleSidebar }
63- >
64- < Menu />
65- </ Button >
66- </ motion . div >
67-
68- < motion . nav className = "flex flex-col gap-2" >
69- { items . map ( ( item ) => (
70- < motion . button
71- key = { item . key }
72- className = { `flex items-center gap-3 rounded-lg font-medium transition-colors ${
73- selected === item . key
74- ? 'bg-primary/10 text-primary'
75- : 'hover:bg-muted/50 text-foreground/80'
76- } ${ isCollapsed ? 'justify-center px-2 py-3' : 'px-4 py-3' } `}
77- onClick = { ( ) => handleNavigation ( item . key ) }
78- title = { isCollapsed ? item . label : undefined }
79- transition = { transition }
80- variants = { variants }
48+ < >
49+ { /* Desktop Sidebar */ }
50+ < motion . aside
51+ className = { `bg-background fixed z-10 hidden h-full flex-col justify-between border-r-[1px] border-gray-100/20 px-4 py-8 pt-24 transition-all duration-300 md:flex ${
52+ isCollapsed ? 'w-20' : 'w-96'
53+ } `}
54+ initial = "hidden"
55+ whileInView = "visible"
56+ transition = { { staggerChildren : 0.04 } }
57+ >
58+ { /* Botão para toggle da sidebar */ }
59+ < div className = "flex flex-col justify-center gap-4" >
60+ < motion . div transition = { transition } variants = { variants } >
61+ < Button
62+ variant = "ghost"
63+ className = "hover:bg-muted/50 text-foreground self-start"
64+ onClick = { toggleSidebar }
8165 >
82- { item . icon }
83- { ! isCollapsed && item . label }
84- </ motion . button >
85- ) ) }
86- </ motion . nav >
87- </ div >
66+ < Menu />
67+ </ Button >
68+ </ motion . div >
8869
89- < Button
90- variant = "ghost"
91- className = { `hover:bg-muted/50 flex items-center text-red-600 ${
92- isCollapsed ? 'justify-center px-2 py-3' : 'gap-2 px-4 py-3'
93- } `}
94- onClick = { handleLogout }
95- title = { isCollapsed ? 'Sair' : undefined }
70+ < motion . nav className = "flex flex-col gap-2" >
71+ { items . map ( ( item ) => (
72+ < motion . button
73+ key = { item . key }
74+ className = { `flex items-center gap-3 rounded-lg font-medium transition-colors ${
75+ selected === item . key
76+ ? 'bg-primary/10 text-primary'
77+ : 'hover:bg-muted/50 text-foreground/80'
78+ } ${ isCollapsed ? 'justify-center px-2 py-3' : 'px-4 py-3' } `}
79+ onClick = { ( ) => handleNavigation ( item . key ) }
80+ title = { isCollapsed ? item . label : undefined }
81+ transition = { transition }
82+ variants = { variants }
83+ >
84+ { item . icon }
85+ { ! isCollapsed && item . label }
86+ </ motion . button >
87+ ) ) }
88+ </ motion . nav >
89+ </ div >
90+
91+ < Button
92+ variant = "ghost"
93+ className = { `hover:bg-muted/50 flex items-center text-red-600 ${
94+ isCollapsed ? 'justify-center px-2 py-3' : 'gap-2 px-4 py-3'
95+ } `}
96+ onClick = { handleLogout }
97+ title = { isCollapsed ? 'Sair' : undefined }
98+ >
99+ < LogOut className = "h-5 w-5" />
100+ { ! isCollapsed && 'Sair' }
101+ </ Button >
102+ </ motion . aside >
103+
104+ { /* Mobile Bottom Navigation */ }
105+ < motion . nav
106+ className = "bg-background/95 fixed right-0 bottom-0 left-0 z-10 flex items-center justify-around border-t border-gray-100/20 px-4 py-3 backdrop-blur-lg md:hidden"
107+ initial = "hidden"
108+ whileInView = "visible"
109+ transition = { { staggerChildren : 0.04 } }
96110 >
97- < LogOut className = "h-5 w-5" />
98- { ! isCollapsed && 'Sair' }
99- </ Button >
100- </ motion . aside >
111+ { items . map ( ( item ) => (
112+ < motion . button
113+ key = { item . key }
114+ className = { `flex flex-col items-center gap-1 rounded-lg px-4 py-2 font-medium transition-colors ${
115+ selected === item . key
116+ ? 'text-primary'
117+ : 'text-foreground/60 hover:text-foreground'
118+ } `}
119+ onClick = { ( ) => handleNavigation ( item . key ) }
120+ transition = { transition }
121+ variants = { variants }
122+ >
123+ < span className = "text-xl" > { item . icon } </ span >
124+ < span className = "text-xs" > { item . label . split ( ' ' ) [ 0 ] } </ span >
125+ </ motion . button >
126+ ) ) }
127+
128+ < motion . button
129+ className = "flex flex-col items-center gap-1 rounded-lg px-4 py-2 font-medium text-red-600 transition-colors hover:text-red-700"
130+ onClick = { handleLogout }
131+ transition = { transition }
132+ variants = { variants }
133+ >
134+ < LogOut className = "h-5 w-5" />
135+ < span className = "text-xs" > Sair</ span >
136+ </ motion . button >
137+ </ motion . nav >
138+ </ >
101139 )
102140}
0 commit comments