1- import React from "react"
1+ import React , { Fragment } from "react"
22import { TABS } from "../(root)/page"
33import { cn } from "@/lib/utils"
4-
4+ import { useIsMobile } from "@/hooks/use-mobile"
5+ import { User , Briefcase , Folder , Mail } from "lucide-react"
56interface NavigationProps {
67 activeTab ?: typeof TABS [ number ]
78 setActiveTab : ( tab : typeof TABS [ number ] ) => void
@@ -11,31 +12,54 @@ export default function Navigation({
1112 activeTab = "profile" ,
1213 setActiveTab,
1314} : NavigationProps ) {
15+
1416 const tabs = [
15- { id : "profile" , label : "Profile" } ,
16- { id : "experience" , label : "Experience" } ,
17- { id : "projects" , label : "Projects" } ,
18- { id : "contact" , label : "Contact" } ,
17+ { id : "profile" , label : "Profile" , icon : < User size = { 16 } /> } ,
18+ { id : "experience" , label : "Experience" , icon : < Briefcase size = { 16 } /> } ,
19+ { id : "projects" , label : "Projects" , icon : < Folder size = { 16 } /> } ,
20+ { id : "contact" , label : "Contact" , icon : < Mail size = { 16 } /> } ,
1921 ] as const
2022
23+ const isMobile = useIsMobile ( )
24+
2125 return (
22- < nav className = " bg-card relative border-b border-border" >
26+ < nav className = { ` bg-card border-b border-border ${ isMobile ? "fixed bottom-0 rounded-ss-2xl left-0 right-0 w-full border-t border-border shadow-lg" : "relative" } ` } >
2327 < div className = "container mx-auto px-4 lg:px-20 xl:px-32" >
24- < div className = "grid grid-cols-2 sm:flex space-x-2 sm:space-x-8 overflow-x-auto" >
28+ < div className = { ` sm:flex space-x-2 sm:space-x-8 overflow-x-auto ${ isMobile ? "flex justify-between" : "" } ` } >
2529 { tabs . map ( ( tab ) => (
26- < button
27- key = { tab . id }
28- onClick = { ( ) => setActiveTab ( tab . id ) }
29- className = { cn (
30- "py-4 px-2 text-sm font-medium border-b-2 transition-colors" ,
31- activeTab === tab . id
32- ? "border-primary text-primary"
33- : "border-transparent text-muted-foreground hover:text-foreground"
34- ) }
35- aria-label = { `Navigate to ${ tab . label } section` }
36- >
37- { tab . label }
38- </ button >
30+ < Fragment key = { tab . id } >
31+ {
32+ isMobile ? (
33+ < button
34+ onClick = { ( ) => setActiveTab ( tab . id ) }
35+ className = { cn (
36+ "py-4 px-2 text-[10px] font-medium border-b-2 transition-colors flex flex-col gap-1 items-center justify-between w-full m-0" ,
37+ activeTab === tab . id
38+ ? "border-primary text-primary"
39+ : "border-transparent text-muted-foreground hover:text-foreground"
40+ ) }
41+ aria-label = { `Navigate to ${ tab . label } section` }
42+ >
43+ < span > { tab . icon } </ span >
44+ < span > { tab . label } </ span >
45+ </ button >
46+ )
47+ : (
48+ < button
49+ onClick = { ( ) => setActiveTab ( tab . id ) }
50+ className = { cn (
51+ "py-4 px-2 text-sm font-medium border-b-2 transition-colors" ,
52+ activeTab === tab . id
53+ ? "border-primary text-primary"
54+ : "border-transparent text-muted-foreground hover:text-foreground"
55+ ) }
56+ aria-label = { `Navigate to ${ tab . label } section` }
57+ >
58+ { tab . label }
59+ </ button >
60+ )
61+ }
62+ </ Fragment >
3963 ) ) }
4064 </ div >
4165 </ div >
0 commit comments