1
- import { useState } from 'react'
2
- import { Link , useNavigate } from 'react-router-dom'
3
- import { useAuth } from '../../context/AuthContext'
4
- import logo from '../../assets/images/logo.png'
5
- import { handleLogin } from '../../services/authService'
6
- import { SiteConfig } from '../../constants/SiteConfig'
1
+ import { useState } from 'react' ;
2
+ import { Link , useNavigate } from 'react-router-dom' ;
7
3
4
+ import { handleLogin } from '../../services/authService' ;
5
+ import { useAuth } from '../../context/AuthContext' ;
6
+ import { SiteConfig } from '../../constants/SiteConfig' ;
7
+ import logo from '../../assets/images/logo.png' ;
8
+
9
+ /**
10
+ * Navigation bar for users to navigate between pages.
11
+ */
8
12
const NavigationBar = ( ) => {
9
- const navigate = useNavigate ( )
13
+ // context for handling user data
10
14
const { isLoggedIn, setIsLoggedIn, setUserData } = useAuth ( )
15
+
16
+ // handles page navigation
17
+ const navigate = useNavigate ( )
18
+
19
+ // menu used for mobile view
11
20
const [ menuOpen , setMenuOpen ] = useState ( false )
12
21
13
22
const toggleMenu = ( ) => {
@@ -17,7 +26,7 @@ const NavigationBar = () => {
17
26
return (
18
27
< nav
19
28
className = "fixed top-0 w-full z-50 opacity-80 bg-black
20
- text-white py-2 px-6 flex justify-between items-center"
29
+ text-white py-2 px-6 flex justify-between items-center"
21
30
style = { { height : '8vh' } }
22
31
>
23
32
< Link to = "/" className = "flex items-center" >
@@ -53,15 +62,15 @@ const NavigationBar = () => {
53
62
{ menuOpen && (
54
63
< div
55
64
className = "absolute right-0 mt-2 bg-gray-800 border
56
- border-gray-600 rounded-md shadow-lg py-1 w-48 z-10"
65
+ border-gray-600 rounded-md shadow-lg py-1 w-48 z-10"
57
66
>
58
67
< ul className = "px-2" >
59
68
{ /* needs improvement */ }
60
69
{ /* <li className="my-1">
61
- <Link to="/about" className="block px-4 py-2 hover:bg-gray-700">
62
- About
63
- </Link>
64
- </li> */}
70
+ <Link to="/about" className="block px-4 py-2 hover:bg-gray-700">
71
+ About
72
+ </Link>
73
+ </li> */}
65
74
< li className = "my-1" >
66
75
< Link
67
76
to = "/plugins"
@@ -106,13 +115,13 @@ const NavigationBar = () => {
106
115
</ li >
107
116
{ /* needs improvement */ }
108
117
{ /* <li className="my-1">
109
- <Link
110
- to="/terms-of-service"
111
- className="block px-4 py-2 hover:bg-gray-700"
112
- >
113
- Terms of Service
114
- </Link>
115
- </li> */}
118
+ <Link
119
+ to="/terms-of-service"
120
+ className="block px-4 py-2 hover:bg-gray-700"
121
+ >
122
+ Terms of Service
123
+ </Link>
124
+ </li> */}
116
125
{ isLoggedIn ? (
117
126
< >
118
127
< li className = "my-1" >
@@ -150,10 +159,10 @@ const NavigationBar = () => {
150
159
< ul className = "hidden md:flex pr-20" >
151
160
{ /* needs improvement */ }
152
161
{ /* <li className="mr-8">
153
- <Link to="/about" className="hover:text-blue-500">
154
- About
155
- </Link>
156
- </li> */}
162
+ <Link to="/about" className="hover:text-blue-500">
163
+ About
164
+ </Link>
165
+ </li> */}
157
166
< li className = "mr-8" >
158
167
< Link to = "/plugins" className = "hover:text-blue-500" >
159
168
Plugins
@@ -189,10 +198,10 @@ const NavigationBar = () => {
189
198
</ li >
190
199
{ /* needs improvement */ }
191
200
{ /* <li className="mr-8">
192
- <Link to="/terms-of-service" className="hover:text-blue-500">
193
- Terms of Service
194
- </Link>
195
- </li> */}
201
+ <Link to="/terms-of-service" className="hover:text-blue-500">
202
+ Terms of Service
203
+ </Link>
204
+ </li> */}
196
205
{ isLoggedIn ? (
197
206
< >
198
207
< li className = "mr-8" >
0 commit comments