Search through charity preview, description, and tags too

This commit is contained in:
Austin Chen 2022-05-05 10:12:16 -04:00
parent 9480f9f34c
commit b42e77858f

View File

@ -40,8 +40,12 @@ export default function Charity(props: {
const filterCharities = useMemo(
() =>
charities.filter((charity) =>
charity.name.toLowerCase().includes(query.toLowerCase())
charities.filter(
(charity) =>
charity.name.toLowerCase().includes(query.toLowerCase()) ||
charity.preview.toLowerCase().includes(query.toLowerCase()) ||
charity.description.toLowerCase().includes(query.toLowerCase()) ||
(charity.tags as string[])?.includes(query.toLowerCase())
),
[query]
)