Skip to content

Conversation

@tzoltie
Copy link
Collaborator

@tzoltie tzoltie commented Jul 31, 2024

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.

@aws-amplify-eu-west-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-152.d1ytr8ocn5wsgw.amplifyapp.com

useEffect(() => {
getCohorts().then(setCohorts)
}, [])
console.log(cohorts)

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

Copy link

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

@Luca-Terrazzan
Copy link

In the future, always include a task reference in the branch name as well

@Luca-Terrazzan
Copy link

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 />}/>
Copy link

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?

useEffect(() => {
getCohorts().then(setCohorts)
}, [])
console.log(cohorts)
Copy link

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);
Copy link

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

Copy link
Collaborator Author

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

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?

@tzoltie tzoltie changed the title functionality added to the left menu functionality added to the right menu Aug 1, 2024
@tzoltie tzoltie requested a review from angustownsley August 1, 2024 14:49
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.

5 participants