Skip to content

Commit 9071773

Browse files
committed
Add header router link
1 parent 5c67c13 commit 9071773

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/components/AppHeader.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Link } from 'react-router-dom';
2+
13
import logoLight from '../images/logo-light.svg';
24
import logoDark from '../images/logo-dark.svg';
35

@@ -10,13 +12,13 @@ const AppHeader = () => {
1012
{/* Header menu links and small screen hamburger menu start */}
1113
<div className="flex justify-between items-center px-4 sm:px-0">
1214
<div>
13-
<a href="/">
15+
<Link to="/">
1416
<img
1517
src={logoDark}
1618
className="w-36"
1719
alt="Dark Logo"
1820
/>
19-
</a>
21+
</Link>
2022
</div>
2123

2224
{/* Theme switcher small screen end */}
@@ -53,27 +55,27 @@ const AppHeader = () => {
5355

5456
{/* Header links start*/}
5557
<div className="m-0 sm:ml-4 mt-5 sm:mt-3 sm:flex p-5 sm:p-0 justify-center items-center shadow-lg sm:shadow-none">
56-
<a
57-
href="/projects"
58+
<Link
59+
to="/projects"
5860
className="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light sm:mx-4 mb-2 sm:py-2"
5961
aria-label="Projects"
6062
>
6163
Projects
62-
</a>
63-
<a
64-
href="/about"
64+
</Link>
65+
<Link
66+
to="/about"
6567
className="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light sm:mx-4 mb-2 sm:py-2 border-t-2 pt-3 sm:pt-2 sm:border-t-0 border-primary-light dark:border-secondary-dark"
6668
aria-label="About Me"
6769
>
6870
About Me
69-
</a>
70-
<a
71-
href="/contact"
71+
</Link>
72+
<Link
73+
to="/contact"
7274
className="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light sm:mx-4 mb-2 sm:py-2 border-t-2 pt-3 sm:pt-2 sm:border-t-0 border-primary-light dark:border-secondary-dark"
7375
aria-label="Contact"
7476
>
7577
Contact
76-
</a>
78+
</Link>
7779
<div className="border-t-2 pt-3 sm:pt-0 sm:border-t-0 border-primary-light dark:border-secondary-dark">
7880
<button
7981
className="sm:hidden block text-left text-md font-medium bg-indigo-500 hover:bg-indigo-600 text-white shadow-sm rounded-md px-4 py-2 mt-2"

0 commit comments

Comments
 (0)