File tree Expand file tree Collapse file tree 2 files changed +38
-3
lines changed
Expand file tree Collapse file tree 2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 11import { Footer } from "./Footer" ;
2+ import { Navbar } from "./Navbar" ;
23
34export function Layout ( { children } : { children : React . ReactNode } ) {
45 return (
5- < div className = "min-h-screen flex flex-col" >
6- < div className = "flex-grow p-8" > { children } </ div >
7- < Footer />
6+ < div className = "min-h-screen flex" >
7+ < Navbar />
8+ < div className = "ml-12 flex flex-col flex-grow min-h-screen" >
9+ < div className = "flex-grow p-8" > { children } </ div >
10+ < Footer />
11+ </ div >
812 </ div >
913 ) ;
1014}
Original file line number Diff line number Diff line change 1+ import { NavLink } from "react-router-dom" ;
2+ import { MdSearch , MdTableChart } from "react-icons/md" ;
3+
4+ const navItems = [
5+ { to : "/" , icon : < MdSearch size = { 20 } /> , label : "Object search" } ,
6+ { to : "/tables" , icon : < MdTableChart size = { 20 } /> , label : "Tables" } ,
7+ ] ;
8+
9+ export function Navbar ( ) {
10+ return (
11+ < nav className = "fixed left-0 top-0 h-screen w-12 flex flex-col items-center pt-4 gap-2 bg-[#1a1a1a] z-20" >
12+ { navItems . map ( ( item ) => (
13+ < NavLink
14+ key = { item . to }
15+ to = { item . to }
16+ end
17+ title = { item . label }
18+ className = { ( { isActive } ) =>
19+ `w-9 h-9 flex items-center justify-center rounded-md transition-colors duration-200 ${
20+ isActive
21+ ? "bg-green-600 text-white"
22+ : "text-neutral-400 hover:bg-neutral-700 hover:text-white"
23+ } `
24+ }
25+ >
26+ { item . icon }
27+ </ NavLink >
28+ ) ) }
29+ </ nav >
30+ ) ;
31+ }
You can’t perform that action at this time.
0 commit comments