Skip to content

Commit 81da6ef

Browse files
committed
Update button
Admin should be able to add question while non admins can match with others
1 parent e873775 commit 81da6ef

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

peerprep-fe/src/components/navbar/Navbar.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ export default function Navbar() {
3838
<Link href="/" className="text-gray-300 hover:text-white">
3939
Questions
4040
</Link>
41-
<Link href="/match" className="text-gray-300 hover:text-white">
42-
Match
43-
</Link>
41+
{/* Admin users should be able to add questions instead of match */}
42+
{user?.isAdmin ?
43+
<Link href="/match" className="text-gray-300 hover:text-white">
44+
Match
45+
</Link> :
46+
<Link href="/add-question" className="text-gray-300 hover:text-white">
47+
Add Question
48+
</Link>}
4449
{isAuth ? (
4550
<DropdownMenu>
4651
<DropdownMenuTrigger asChild>

0 commit comments

Comments
 (0)