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.
needed? if not, remove console logs
|
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.
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) |
| !menuRef.current.contains(event.target) && | ||
| !event.target.closest(".link-to-profile") | ||
| ) { | ||
| setSelectedProfileId(null); |
There was a problem hiding this comment.
Where is this setSelectedProfileId function defined? I can't see it in this file
There was a problem hiding this comment.
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.
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.