-
Notifications
You must be signed in to change notification settings - Fork 0
functionality added to the right menu #152
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
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
src/components/cohorts/index.jsx
Outdated
| useEffect(() => { | ||
| getCohorts().then(setCohorts) | ||
| }, []) | ||
| console.log(cohorts) |
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.
needed? if not, remove console logs
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 log is still here
|
In the future, always include a task reference in the branch name as well |
|
The title is "functionality added to the left menu"... what functionality am I looking at @tzoltie ? |
src/App.jsx
Outdated
| <Profile /> | ||
| </ProtectedRoute> | ||
| } /> | ||
| <Route path="/students" element={<Students />}/> |
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.
Shouldn't this be in a ProtectedRoute to prevent accessing it unless you're logged in?
src/components/cohorts/index.jsx
Outdated
| useEffect(() => { | ||
| getCohorts().then(setCohorts) | ||
| }, []) | ||
| console.log(cohorts) |
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 log is still here
| !menuRef.current.contains(event.target) && | ||
| !event.target.closest(".link-to-profile") | ||
| ) { | ||
| setSelectedProfileId(null); |
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.
Where is this setSelectedProfileId function defined? I can't see it in this file
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 function is used to remove the rendered profile popup after the three dot button is clicked, and the user clicks on another part of the screen. It's used in the onClickMenu to ensure when the profile is clicked it takes the user to that users profile page
| <span>{`${user.firstName} ${user.lastName}`}</span> | ||
| <p>{`Software Developer, Cohort ${user.cohortId}`}</p> | ||
| </div> | ||
| {name === "searchResults" && currentUser.role === "TEACHER" |
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'm not sure I like the idea that there's a conditional render based on a string value "searchResults", what are some other ways you could approach this component?
The right menu that displays active cohorts, students and teachers has been added. In the student section only 10 students will be shown at a time - any more a "All students" button renders and when clicked takes the user to another page that lists all students. The three dot menu when clicked will allow users to visit their own and another users page, this is currently unavailable as the profile page has been completed and merged yet. Hopefully this will be completed today.