
Submitted about 2 years ago
Job listings with filtering- React, Next JS, Tailwind, GraphQL, CMS
#next#react#tailwind-css#graphql
@Eileenpk
Design comparison
SolutionDesign
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!
Community feedback
Please log in to post a comment
Log in with GitHubJoin 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