Submitted almost 3 years agoA solution to the Job listings with filtering challenge
Job listings with filtering- React, Next JS, Tailwind, GraphQL, CMS
next, react, tailwind-css, graphql
@Eileenpk

Solution retrospective
This was a fun project, I used Hygraph to make a CMS for the listings and then queried it with GraphQL. I was going to make a filter function to filter through the listings based on the selected tag but in the end, I found that a much better solution was
const match = tagsArray.some((i) => itemsArray.includes(i));
if (itemsArray.length === 0 || match) {
return (
//show cards that match selected tags, or show all cards if no tags are selected...
)
}
This is a great way to compare two arrays to see if any of the items match to one another!
Please feel free to leave comments or suggestions!
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Eileen dangelo's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord