-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
const formattedCourseName = (course: IdentifiableCourse) => { | ||
const formattedCourseId = course.id | ||
.toUpperCase() | ||
.replace(/([a-zA-Z]+)(\d+)/, "$1 $2"); |
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.
Double checking - should there be a space?
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.
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.
src/app/components/Sidebar.tsx
Outdated
|
||
React.useEffect(() => { | ||
const loadCourses = async () => { | ||
const allCourses = await getCourses(); |
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.
We probably should do the filtering on database side.
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.
is that making a server component?
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.
The query to firebase should already filter to the course ids we're interested in.
Double checking, we need to place this in |
According to the Figma, I don't think so? there's no Menu Icon |
src/app/services/client/course.ts
Outdated
export const getCoursesByIds = async ( | ||
courseIds: String[] | ||
): Promise<IdentifiableCourse[]> => { | ||
const courses = courseIds.map((id) => getCourse(id)); |
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.
I think firestore should support filtering https://cloud.google.com/firestore/docs/query-data/queries#in_not-in_and_array-contains-any
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):Behavior on
[email protected]
account (has only cs40):Should appear as Drawer upon clicking MenuIcon on the Header
Test
Test all courses in sidebar + manage courses on each of the 4 routes:
/private/course/[courseId]/profile/edit
(not implemented yet but I think it's supposed to be like that according to Figma?)/private/course/cs160
and presscs40
, 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!