22import { Button } from "@/components/ui/button" ;
33import { Github , Download , ExternalLink } from "lucide-react" ;
44import { Link } from "react-router-dom" ;
5+ import { HashLink } from "react-router-hash-link" ;
56
6- // NEW: add a prop type
7- type HeaderProps = {
8- minimal ?: boolean ; // when true, hide nav + buttons
9- } ;
7+ type HeaderProps = { minimal ?: boolean } ;
108
119const Header = ( { minimal = false } : HeaderProps ) => {
1210 return (
1311 < header className = "sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60" >
14- { /* Grid: [logo] [centered nav] [buttons] */ }
1512 < div className = "container grid grid-cols-[auto_1fr_auto] items-center h-16 px-4" >
16- { /* Left: Logo */ }
17- < div className = "flex items-center space-x-3" >
18- < img
19- src = { `${ import . meta. env . BASE_URL } logo.png` }
20- alt = "Endoshare Logo"
13+ { /* Left: Logo → go home */ }
14+ < Link to = "/" className = "flex items-center space-x-3" >
15+ < img
16+ src = { `${ import . meta. env . BASE_URL } logo.png` }
17+ alt = "Endoshare Logo"
2118 className = "h-8 w-8"
2219 />
2320 < h1 className = "text-xl font-bold" > Endoshare</ h1 >
24- </ div >
21+ </ Link >
2522
26- { /* Center: Nav (truly centered, independent of side widths) */ }
23+ { /* Center: Nav */ }
2724 { ! minimal && (
2825 < nav className = "hidden md:flex justify-self-center items-center gap-6 min-w-0" >
29- < a href = "/#features" className = "text-muted-foreground hover:text-foreground transition-colors" >
26+ < HashLink smooth to = "/#features" className = "text-muted-foreground hover:text-foreground transition-colors" >
3027 Features
31- </ a >
32- < a href = "/#download" className = "text-muted-foreground hover:text-foreground transition-colors" >
28+ </ HashLink >
29+ < HashLink smooth to = "/#download" className = "text-muted-foreground hover:text-foreground transition-colors" >
3330 Download
34- </ a >
31+ </ HashLink >
3532 < a
3633 href = "https://github.com/CAMMA-public/Endoshare_code"
3734 className = "text-muted-foreground hover:text-foreground transition-colors"
@@ -40,9 +37,9 @@ const Header = ({ minimal = false }: HeaderProps) => {
4037 >
4138 GitHub
4239 </ a >
43- < a href = "/#about" className = "text-muted-foreground hover:text-foreground transition-colors" >
40+ < HashLink smooth to = "/#about" className = "text-muted-foreground hover:text-foreground transition-colors" >
4441 About
45- </ a >
42+ </ HashLink >
4643 < Link to = "/docs" className = "text-muted-foreground hover:text-foreground transition-colors" >
4744 Documentation
4845 </ Link >
@@ -75,10 +72,10 @@ const Header = ({ minimal = false }: HeaderProps) => {
7572 </ a >
7673 </ Button >
7774 < Button size = "sm" asChild >
78- < a href = "/#download" className = "flex items-center gap-2" >
75+ < HashLink smooth to = "/#download" className = "flex items-center gap-2" >
7976 < Download className = "h-4 w-4" />
8077 < span className = "hidden sm:inline" > Download</ span >
81- </ a >
78+ </ HashLink >
8279 </ Button >
8380 </ div >
8481 ) }
0 commit comments