-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNavBar.jsx
More file actions
117 lines (107 loc) · 2.49 KB
/
NavBar.jsx
File metadata and controls
117 lines (107 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { Link } from "react-router-dom";
import loginProfile from "./loginprofile.png";
import { useEffect, useState } from "react";
import { auth } from "../firebase";
import { onAuthStateChanged } from "firebase/auth";
export const Navbar = () => {
const [user, setUser] = useState(null);
useEffect(() => {
const unsubscribe = onAuthStateChanged(auth, (currentUser) => {
setUser(currentUser);
});
return () => unsubscribe();
}, []);
return (
<div style={styles.wrapper}>
<nav style={styles.nav}>
<div style={styles.logoContainer}>
<div style={styles.logoSmall}>
Open
<br />
Source
<br />
with
</div>
<div style={styles.logoBig}>SLU</div>
</div>
<ul style={styles.navLinks}>
<li>
<Link to="/" style={styles.link}>
Home
</Link>
</li>
<li>
<Link to="/team-stats" style={styles.link}>
Team
</Link>
</li>
<li style={{ textAlign: "center" }}>
<Link to="/login" style={styles.link}>
<img src={loginProfile} alt="Profile" style={styles.profileImg} />
</Link>
{/* text to say signed in */}
{user && <div style={styles.signedInText}>Signed in!</div>}
</li>
</ul>
</nav>
</div>
);
};
const styles = {
wrapper: {
width: "100%",
display: "flex",
justifyContent: "center",
marginTop: "20px",
},
nav: {
display: "flex",
justifyContent: "space-between",
alignItems: "center",
padding: "1rem 2rem",
width: "100%",
backgroundColor: "#123f8b",
color: "white",
borderRadius: "18px",
fontFamily: '"Times New Roman", Times, serif',
},
logoContainer: {
display: "flex",
alignItems: "center",
gap: "10px",
},
logoSmall: {
fontSize: "12px",
lineHeight: "12px",
textAlign: "right",
},
logoBig: {
fontSize: "36px",
fontWeight: "bold",
letterSpacing: "2px",
},
navLinks: {
display: "flex",
listStyle: "none",
gap: "40px",
margin: 0,
padding: 0,
fontSize: "1.2rem",
alignItems: "center",
},
link: {
color: "white",
textDecoration: "none",
},
profileImg: {
width: "40px",
height: "40px",
objectFit: "cover",
cursor: "pointer",
},
signedInText: {
fontSize: "12px",
marginTop: "5px",
color: "#A8D0FF",
},
};