-
Notifications
You must be signed in to change notification settings - Fork 6
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
Jobs page filtering functionality #123
Conversation
…the first two filters
… component and amended the filterData.js
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Spectacular work as always!!😍
Your code is so beautifully written! It is art!😎
Keep up the ✨AMAZING✨ work!🙌🚀
@@ -8,16 +8,16 @@ function CombiningFilterComponents() { | |||
const [data, setData] = useState(filterData); | |||
|
|||
return ( | |||
<div className="App px-7"> | |||
<div className="App bg-gray-200 px-7 bg-gray-200 "> |
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.
Kudos to you!!
The component looks nicer now!!
const minSalaryArray = filterData.map((item) => item.minSalary); | ||
const minSalaryValue = Math.min(...minSalaryArray); | ||
|
||
const maximumSalaryArray = filterData.map((item) => item.maxSalary); | ||
const maxSalaryValue = Math.max(...maximumSalaryArray); |
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 love how you took advantage of the built-in Math function of min and max!!🔥
This is a very clever way of doing things!👏
useEffect(() => { | ||
setData( | ||
filterData.filter((item) => { | ||
if ( | ||
item.minSalary >= filter.salary.min && | ||
item.minSalary <= filter.salary.max | ||
) { | ||
return item; | ||
} | ||
return null; | ||
}) | ||
); | ||
}, [filter.salary]); |
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.
Awesome work on achieving the filtering!!
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.
Thank you @AllanSaleh for your continuous support and guidance! I really appreciate your efforts and dedication! Have a lovely day 🙏
This PR is related to issue #35 :)
I have also updated the data file to make dealing with data easier!