Skip to content
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

Course navigation sidebar #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Course navigation sidebar #31

wants to merge 7 commits into from

Conversation

locmai1
Copy link
Collaborator

@locmai1 locmai1 commented Dec 15, 2024

Description

Added functionality to the MenuIcon. Only existing right now on 4 pages so far:

  • private/course
  • private/course/[courseId]
  • private/course/[courseId]/queue
  • private/course/[courseId]/profile

Issues

None :)

Screenshots

Behavior on [email protected] account (has all courses cs160 & cs40):

image

Behavior on [email protected] account (has only cs40):

image

Should appear as Drawer upon clicking MenuIcon on the Header

Test

Test all courses in sidebar + manage courses on each of the 4 routes:

  • Manage Courses will route to /private/course/[courseId]/profile/edit (not implemented yet but I think it's supposed to be like that according to Figma?)
  • Course will route to according course and if on /private/course/cs160 and press cs40, it should route to /private/course/cs40

Possible Downsides

None :) (that I can think of)

Additional Documentations

Not sure that I did this the best way: used memo and a provider to reduce props drilling and should only re-render on change to userSession doc. Please let me know!

const formattedCourseName = (course: IdentifiableCourse) => {
const formattedCourseId = course.id
.toUpperCase()
.replace(/([a-zA-Z]+)(\d+)/, "$1 $2");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Double checking - should there be a space?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I think so, according to Figma at least:

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see some wireframe has it together - might be worth confirming with Fa and Sarah
image


React.useEffect(() => {
const loadCourses = async () => {
const allCourses = await getCourses();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably should do the filtering on database side.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is that making a server component?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The query to firebase should already filter to the course ids we're interested in.

@nickbar01234
Copy link
Collaborator

Double checking, we need to place this in /board page too right?

@locmai1
Copy link
Collaborator Author

locmai1 commented Dec 15, 2024

Double checking, we need to place this in /board page too right?

According to the Figma, I don't think so? there's no Menu Icon

export const getCoursesByIds = async (
courseIds: String[]
): Promise<IdentifiableCourse[]> => {
const courses = courseIds.map((id) => getCourse(id));
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

2 participants