Skip to content

Commit deddf47

Browse files
Create NavBar.js
1 parent 8f5f966 commit deddf47

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/components/NavBar.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import React from "react";
2+
import { NavLink } from "react-router-dom";
3+
4+
export default function NavBar() {
5+
const linkStyle = {
6+
color: "white",
7+
textDecoration: "none",
8+
marginRight: "20px",
9+
fontSize: "18px"
10+
};
11+
12+
const activeStyle = {
13+
textDecoration: "underline"
14+
};
15+
16+
return (
17+
<nav
18+
style={{
19+
width: "100%",
20+
padding: "12px 20px",
21+
backgroundColor: "#222",
22+
color: "white",
23+
display: "flex",
24+
alignItems: "center"
25+
}}
26+
>
27+
<NavLink
28+
to="/"
29+
style={linkStyle}
30+
activeStyle={activeStyle}
31+
>
32+
Home
33+
</NavLink>
34+
35+
<NavLink
36+
to="/about"
37+
style={linkStyle}
38+
activeStyle={activeStyle}
39+
>
40+
About
41+
</NavLink>
42+
</nav>
43+
);
44+
}

0 commit comments

Comments
 (0)