-
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
base: development
Are you sure you want to change the base?
Conversation
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
|
||
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.
const handleSortAZ = () => { | ||
const sorted = [...sortedMentors].sort((a, b) => | ||
a.application.firstName.localeCompare(b.application.firstName) |
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.
What's the issue here?
className="form-checkbox h-4 w-4 text-blue-500" | ||
/> | ||
<span className="text-gray-700"> | ||
{slots} Slots Available |
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.
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.