Handle blank as the inbox term in the search filter buttons

This commit is contained in:
Jackson Harper
2022-04-25 13:07:54 -07:00
parent 605f13432f
commit 4e211f447d

View File

@ -612,10 +612,14 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
}}
>
{Object.keys(SAVED_SEARCHES).map((key) => {
const isInboxTerm = (term: string) => {
return !term || term === 'in:inbox'
}
const searchQuery = SAVED_SEARCHES[key]
const style =
searchQuery === props.searchTerm ||
(!props.searchTerm && !searchQuery)
(!props.searchTerm && isInboxTerm(searchQuery))
? 'ctaDarkYellow'
: 'ctaLightGray'
return (