|
1 | 1 | importImagefrom"next/image"; |
2 | 2 | importLinkfrom"next/link"; |
| 3 | +import{useEffect,useState}from'react'; |
3 | 4 |
|
4 | 5 | constNavbar=()=>{ |
| 6 | +const[path,setPath]=useState<String>(''); |
| 7 | +useEffect(()=>{ |
| 8 | +letitem:string=window.location.href.split("/").pop()!; |
| 9 | +if(item==''||item==undefined)setPath('HOME'); |
| 10 | +elsesetPath(item.toUpperCase()); |
| 11 | +}) |
| 12 | + |
5 | 13 | return( |
6 | 14 | <navclassName="flex justify-between items-center relative z-10"> |
7 | 15 | <Linkhref="/"> |
8 | 16 | <Imagesrc="/assets/csesoc_logo.svg"alt="CSESoc Logo"width={200}height={200}draggable={false}/> |
9 | | -<pclassName="mt-3 text-xs">C:\INTERNAL STRUCTURE\HOME</p> |
| 17 | +<pclassName="mt-3 text-xs">C:\INTERNAL STRUCTURE\{path}</p> |
10 | 18 | </Link> |
11 | 19 | <div> |
12 | 20 | <divclassName="md:flex xl:gap-36 lg:gap-20 md:gap-10 text-right font-bold hidden"> |
13 | | -<Linkhref="#about"> |
| 21 | +<Linkhref="about us"> |
14 | 22 | <pclassName="text-[0.6rem] text-[#C4C5C8]">01</p> |
15 | 23 | <div>{"//"} about us</div> |
16 | 24 | </Link> |
17 | | -<Linkhref="#events"> |
| 25 | +<Linkhref="events"> |
18 | 26 | <pclassName="text-[0.6rem] text-[#C4C5C8]">02</p> |
19 | 27 | <div>{"//"} events</div> |
20 | 28 | </Link> |
21 | | -<Linkhref="#resources"> |
| 29 | +<Linkhref="resources"> |
22 | 30 | <pclassName="text-[0.6rem] text-[#C4C5C8]">03</p> |
23 | 31 | <div>{"//"} resources</div> |
24 | 32 | </Link> |
|