Hide pills while searching

This commit is contained in:
James Grugett 2022-08-03 14:17:45 -07:00
parent 280308b625
commit a761f8c65e

View File

@ -107,7 +107,7 @@ export function ContractSearch(props: {
const [filter, setFilter] = useState<filter>( const [filter, setFilter] = useState<filter>(
querySortOptions?.defaultFilter ?? 'open' querySortOptions?.defaultFilter ?? 'open'
) )
const pillsEnabled = !additionalFilter const pillsEnabled = !additionalFilter && !query
const [pillFilter, setPillFilter] = useState<string | undefined>(undefined) const [pillFilter, setPillFilter] = useState<string | undefined>(undefined)
@ -126,7 +126,7 @@ export function ContractSearch(props: {
? `groupLinks.slug:${additionalFilter.groupSlug}` ? `groupLinks.slug:${additionalFilter.groupSlug}`
: '', : '',
] ]
let facetFilters = query const facetFilters = query
? additionalFilters ? additionalFilters
: [ : [
...additionalFilters, ...additionalFilters,
@ -154,8 +154,6 @@ export function ContractSearch(props: {
`uniqueBettorIds:${user.id}` `uniqueBettorIds:${user.id}`
: '', : '',
].filter((f) => f) ].filter((f) => f)
// Hack to make Algolia work.
facetFilters = ['', ...facetFilters]
const numericFilters = query const numericFilters = query
? [] ? []