File tree Expand file tree Collapse file tree 1 file changed +19
-18
lines changed
frontend/src/app/home/components/navbar Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -3,25 +3,26 @@ import Link from "next/link";
3
3
import Header from "@/components/ui/Header" ;
4
4
5
5
const Navbar = ( ) => {
6
- return (
7
- < nav className = "flex justify-between items-center p-4 bg-gray-900" >
8
- < div className = "flex-shrink-0" >
9
- < Header />
10
- </ div >
6
+ const isActive = ( path : string ) => window . location . pathname === path ;
7
+ return (
8
+ < nav className = "flex justify-between items-center p-4 bg-gray-900" >
9
+ < div className = "flex-shrink-0" >
10
+ < Header />
11
+ </ div >
11
12
12
- < div className = "flex space-x-6" >
13
- < Link href = "/home" className = " text-primary-300" >
14
- Home
15
- </ Link >
16
- < Link href = "" className = " text-primary-300 opacity-50 hover:opacity-100">
17
- About Us
18
- </ Link >
19
- < Link href = "https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g15" className = "text-primary-300 opacity-50 hover:opacity-100" >
20
- Our Codebase
21
- </ Link >
22
- </ div >
23
- </ nav >
24
- ) ;
13
+ < div className = "flex space-x-6" >
14
+ < Link href = "/home" className = { ` text-primary-300 hover:underline ${ isActive ( "/home" ) ? "opacity-100" : "opacity-50 hover:opacity-100" } ` } >
15
+ Home
16
+ </ Link >
17
+ < Link href = "" className = { ` text-primary-300 hover:underline ${ isActive ( "/about" ) ? " opacity-100" : "opacity- 50 hover:opacity-100"} ` } >
18
+ About Us
19
+ </ Link >
20
+ < Link href = "https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g15" className = "text-primary-300 opacity-50 hover:underline hover:opacity-100" >
21
+ Our Codebase
22
+ </ Link >
23
+ </ div >
24
+ </ nav >
25
+ ) ;
25
26
} ;
26
27
27
28
export default Navbar ;
You can’t perform that action at this time.
0 commit comments