-
Notifications
You must be signed in to change notification settings - Fork 0
hamburger nav bar for participant #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be on all pages, not just the participant one. Like if im on / i need to be able to see the hamburger thing as well
I am just going to extend this ticket as well, you need to make it role based. Based on role you have to render a specific navbar for each role based on what they are able to access
For example, normal participants shouldnt see any links leading to the admin dashboard or anything because that wouldnt make sense, nor judges |
…has admin dashboard bcuz doenst really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i changed, lmk if you want me to do anything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"use client"; | ||
|
||
import ParticipantNav from "@/components/Dashboard/ParticipantNav"; | ||
import { useUser } from "@/components/contexts/UserContext"; | ||
import JudgeNav from "@/components/judging/Navbar"; | ||
|
||
export default function UserBasedNav() { | ||
const { currentUser } = useUser(); | ||
const loading = !currentUser; // Assume loading is true when currentUser is null or undefined | ||
|
||
if (loading) { | ||
return <div className="p-4 text-center">Loading...</div>; | ||
} | ||
|
||
// Assume that currentUser.role is set appropriately (e.g. "Admin", "Judge", or "Participant") | ||
const role = currentUser?.role || "Participant"; | ||
|
||
if (role === "Admin") { | ||
// For Admins, render the side and top navigation together | ||
return <div className="flex "></div>; | ||
} else if (role === "Judge") { | ||
return <JudgeNav />; | ||
} else { | ||
return <ParticipantNav />; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad code
you will end up writing three separate components when you can just write a single one
make a map of admin, judging and particpant links
and just map the role to the array of data that contains the links and pass that as props
…hows up in every page based on user. deleted chat gpt comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good do you think we should have the purple awesomer font colors on the border when hovering? Or is that too much?
No description provided.