Skip to content

Commit f4cb099

Browse files
Lorenzo ArboitLorenzo Arboit
authored andcommitted
page links
1 parent 6497889 commit f4cb099

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

src/components/Header.tsx

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,33 @@
22
import { Button } from "@/components/ui/button";
33
import { Github, Download, ExternalLink } from "lucide-react";
44
import { 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

119
const 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
)}

src/components/Hero.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Button } from "@/components/ui/button";
22
import { Shield, Video, Users, Download, Github, ArrowRight } from "lucide-react";
3+
import { HashLink } from "react-router-hash-link";
34

45
const Hero = () => {
56
return (
@@ -32,11 +33,11 @@ const Hero = () => {
3233

3334
<div className="flex flex-col sm:flex-row gap-4 justify-center items-center mb-16">
3435
<Button size="lg" className="w-full sm:w-auto" asChild>
35-
<a href="/#download" className="flex items-center gap-2">
36+
<HashLink smooth to="/#download" className="flex items-center gap-2">
3637
<Download className="h-5 w-5" />
3738
Download Endoshare
3839
<ArrowRight className="h-4 w-4" />
39-
</a>
40+
</HashLink>
4041
</Button>
4142

4243
<Button variant="outline" size="lg" className="w-full sm:w-auto" asChild>

0 commit comments

Comments
 (0)