Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Scenarioswebapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TokaKaram
Scenarioswebapp
Commits
51309db4
Commit
51309db4
authored
Jan 07, 2026
by
TokaKaram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change navbar activity
parent
546d717e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
Navbar.jsx
frontend/src/components/Layout/Navbar.jsx
+14
-14
No files found.
frontend/src/components/Layout/Navbar.jsx
View file @
51309db4
import
{
Link
,
useNavigate
}
from
'react-router-dom'
;
import
{
Nav
Link
,
useNavigate
}
from
'react-router-dom'
;
import
{
useAuth
}
from
'../../context/AuthContext'
;
import
{
FiHome
,
FiUser
,
FiLogOut
,
FiAward
,
FiClock
,
FiSettings
}
from
'react-icons/fi'
;
...
...
@@ -15,34 +15,34 @@ export default function Navbar() {
<
nav
className=
"bg-white shadow-lg"
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex justify-between items-center h-16"
>
<
Link
to=
"/"
className=
"text-2xl font-bold text-indigo-600"
>
MCQ App
</
Link
>
<
NavLink
to=
"/"
className=
"text-2xl font-bold text-indigo-600"
>
MCQ App
</
Nav
Link
>
{
user
?
(
<
div
className=
"flex items-center gap-6"
>
<
Link
to=
"/"
className=
"flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition"
>
<
NavLink
to=
"/"
className=
{
({
isActive
})
=>
(
isActive
?
'text-indigo-600 flex items-center gap-2 hover:text-indigo-600 transition'
:
'flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition'
)
}
>
<
FiHome
/>
Quizzes
</
Link
>
<
Link
to=
"/leaderboard"
className=
"flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition"
>
</
Nav
Link
>
<
NavLink
to=
"/leaderboard"
className=
{
({
isActive
})
=>
(
isActive
?
'text-indigo-600 flex items-center gap-2 hover:text-indigo-600 transition'
:
'flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition'
)
}
>
<
FiAward
/>
Leaderboard
</
Link
>
<
Link
to=
"/history"
className=
"flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition"
>
</
Nav
Link
>
<
NavLink
to=
"/history"
className=
{
({
isActive
})
=>
(
isActive
?
'text-indigo-600 flex items-center gap-2 hover:text-indigo-600 transition'
:
'flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition'
)
}
>
<
FiClock
/>
History
</
Link
>
</
Nav
Link
>
{
user
.
role
===
'admin'
&&
(
<
Link
to=
"/admin"
className=
"flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition"
>
<
NavLink
to=
"/admin"
className=
{
({
isActive
})
=>
(
isActive
?
'text-indigo-600 flex items-center gap-2 hover:text-indigo-600 transition'
:
'flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition'
)
}
>
<
FiSettings
/>
Admin
</
Link
>
</
Nav
Link
>
)
}
<
Link
to=
"/profile"
className=
"flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition"
>
<
NavLink
to=
"/profile"
className=
{
({
isActive
})
=>
(
isActive
?
'text-indigo-600 flex items-center gap-2 hover:text-indigo-600 transition'
:
'flex items-center gap-2 text-gray-600 hover:text-indigo-600 transition'
)
}
>
<
FiUser
/>
{
user
.
username
}
</
Link
>
</
Nav
Link
>
<
button
onClick=
{
handleLogout
}
className=
"flex items-center gap-2 text-red-500 hover:text-red-700 transition"
>
<
FiLogOut
/>
Logout
</
button
>
</
div
>
)
:
(
<
div
className=
"flex items-center gap-4"
>
<
Link
to=
"/login"
className=
"text-gray-600 hover:text-indigo-600 transition"
>
Login
</
Link
>
<
Link
to=
"/register"
className=
"bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition"
>
Sign Up
</
Link
>
<
NavLink
to=
"/login"
className=
"text-gray-600 hover:text-indigo-600 transition"
>
Login
</
Nav
Link
>
<
NavLink
to=
"/register"
className=
"bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition"
>
Sign Up
</
Nav
Link
>
</
div
>
)
}
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment