Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

anthonyych4n
Copy link
Contributor

No description provided.

Copy link
Contributor

@burtonjong burtonjong left a 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

@burtonjong
Copy link
Contributor

For example, normal participants shouldnt see any links leading to the admin dashboard or anything because that wouldnt make sense, nor judges

Copy link
Contributor Author

@anthonyych4n anthonyych4n left a 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

Copy link
Contributor

@burtonjong burtonjong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

what happened here lol

also delete the chatgpt comments bro LOL

Comment on lines 1 to 26
"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 />;
}
}
Copy link
Contributor

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
Copy link
Contributor

@fisayoadabs fisayoadabs left a 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants