Skip to content

Commit

Permalink
feat(grid): return tags in search results (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohitstom committed Sep 2, 2023
1 parent 370ded2 commit bba371f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,13 @@ class Grid extends React.Component<
const cardsOfType = this.cardList.filter((card) => card.props.type === cardType.handle)
.filter((card) => {
const searchValue = this.state.searchValue.trim().toLowerCase();
const { title, user, authors } = card.props.item;
const { title, user, authors, tags } = card.props.item;

return !searchValue ||
title.toLowerCase().includes(searchValue) ||
user?.toLowerCase().includes(searchValue) ||
authors?.some((author) => author.name.toLowerCase().includes(searchValue));
authors?.some((author) => author.name.toLowerCase().includes(searchValue)) ||
tags?.some((tag) => tag.toLowerCase().includes(searchValue));
})
.map((card) => {
// Clone the cards and update the prop to trigger re-render
Expand Down

0 comments on commit bba371f

Please sign in to comment.