-
Notifications
You must be signed in to change notification settings - Fork 58
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
Enhance Mentor Filter Functionality #226
Enhance Mentor Filter Functionality #226
Conversation
src/pages/Mentors/index.tsx
Outdated
setUniqueCountries([...new Set(countries)]); | ||
|
||
const availableSlots = allMentors | ||
.map((mentor) => { |
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.
can you check mentor.application object for the availableSlots and approvedMenteesCount. It should be there. @rdwaynedehoedt
src/pages/Mentors/index.tsx
Outdated
|
||
if (selectedAvailableSlots.length > 0) { | ||
allMentors = allMentors.filter((mentor) => { | ||
const approvedMenteesCount = mentor?.mentees |
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.
Same here.
@anjula-sack review the PR. |
package.json
Outdated
"@hookform/resolvers": "^3.3.4", | ||
"@mui/material": "^6.1.10", |
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.
Do we need to use material here?
Purpose
The purpose of this PR is to fix #223. This PR introduces a feature to filter mentors by country, available slots, and category, while also providing sorting functionality. It addresses the need for improved mentor filtering and sorting on the Mentor page.
Goals
Approach
This feature was implemented by:
useEffect
hooks.The logic for available slots ensures that mentors with no available slots (after considering approved mentees) are excluded from the list unless selected by the user.
Screenshots
Checklist
Test environment
Learning
useState
,useEffect
, anduseInView
for infinite scroll.