11// src/components/nav.rs
2- use yew:: prelude:: * ;
3- use yew_router:: prelude:: * ;
42use crate :: app:: { Route , ThemeContext } ;
5- use web_sys:: HtmlElement ;
63use gloo:: events:: EventListener ;
4+ use web_sys:: HtmlElement ;
5+ use yew:: prelude:: * ;
6+ use yew_router:: prelude:: * ;
77
88#[ function_component( Nav ) ]
99pub fn nav ( ) -> Html {
@@ -35,10 +35,10 @@ pub fn nav() -> Html {
3535 let icon_transform = if * collapsed { "" } else { "rotate-180" } ;
3636
3737 html ! {
38- <div ref={ nav_ref. clone( ) } class={ classes!( "sidebar" , sidebar_width, "transition-all" , "duration-300" , "ease-in-out" ,
39- "h-screen" , "fixed" , "top-0" , "left-0" , "z-40" , "flex" , "flex-col" ,
38+ <div ref={ nav_ref. clone( ) } class={ classes!( "sidebar" , sidebar_width, "transition-all" , "duration-300" , "ease-in-out" ,
39+ "h-screen" , "fixed" , "top-0" , "left-0" , "z-40" , "flex" , "flex-col" ,
4040 "bg-gray-800" , "dark:bg-gray-900" , "text-white" , "shadow-lg" ) } >
41-
41+
4242 // Logo and collapse button
4343 <div class="flex items-center justify-between p-4 border-b border-gray-700" >
4444 <div class={ classes!( "logo" , if * collapsed { "hidden" } else { "" } ) } >
@@ -55,15 +55,15 @@ pub fn nav() -> Html {
5555 </svg>
5656 </button>
5757 </div>
58-
58+
5959 // Navigation menu
6060 <div class="flex flex-col flex-grow py-4 overflow-y-auto" >
6161 {
6262 menu_items. into_iter( ) . map( |( route, label, icon) | {
6363 let to = route. clone( ) ;
6464 html! {
6565 <Link <Route > to={ to} classes={ classes!(
66- "flex" , "items-center" , "px-4" , "py-3" , "text-lg" ,
66+ "flex" , "items-center" , "px-4" , "py-3" , "text-lg" ,
6767 "hover:bg-gray-700" , "transition-colors" , "duration-200" ,
6868 "focus:outline-none" , "focus:bg-gray-700" ,
6969 ) } >
@@ -78,7 +78,7 @@ pub fn nav() -> Html {
7878 } ) . collect:: <Html >( )
7979 }
8080 </div>
81-
81+
8282 // Theme toggle and user section
8383 <div class="p-4 border-t border-gray-700" >
8484 <button
@@ -100,4 +100,4 @@ pub fn nav() -> Html {
100100 </div>
101101 </div>
102102 }
103- }
103+ }
0 commit comments