nave items displayed based on role
This commit is contained in:
parent
4ee194f102
commit
a28dc7d356
1 changed files with 18 additions and 13 deletions
|
|
@ -14,7 +14,7 @@ const Navbar = () => {
|
|||
|
||||
async function handleLogout() {
|
||||
window.open(`${authUrl}/auth/logout`, "_self");
|
||||
};
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// Set active link based on current path
|
||||
|
|
@ -128,6 +128,8 @@ const Navbar = () => {
|
|||
<span className="navbar__link-hover"></span>
|
||||
</Link>
|
||||
</li> */}
|
||||
|
||||
{user && user.role === "instructor" && (
|
||||
<li>
|
||||
<Link
|
||||
to="/assignment"
|
||||
|
|
@ -140,6 +142,8 @@ const Navbar = () => {
|
|||
<span className="navbar__link-hover"></span>
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
{user && user.role === "student" && (
|
||||
<li>
|
||||
<Link
|
||||
to="/editor"
|
||||
|
|
@ -152,6 +156,7 @@ const Navbar = () => {
|
|||
<span className="navbar__link-hover"></span>
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
<li>
|
||||
{user ? (
|
||||
<a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue