Default to 'all' search filter for markets on user page

This commit is contained in:
James Grugett 2022-05-11 00:19:13 -04:00
parent b55e807c62
commit 2b9e639281
2 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,7 @@ type filter = 'open' | 'closed' | 'resolved' | 'all'
export function ContractSearch(props: {
querySortOptions?: {
defaultSort: Sort
defaultFilter?: filter
filter?: {
creatorId?: string
tag?: string
@ -60,7 +61,9 @@ export function ContractSearch(props: {
? initialSort
: querySortOptions?.defaultSort
const [filter, setFilter] = useState<filter>('open')
const [filter, setFilter] = useState<filter>(
querySortOptions?.defaultFilter ?? 'open'
)
if (!sort) return <></>
return (

View File

@ -59,6 +59,7 @@ export function CreatorContractsList(props: { creator: User }) {
creatorId: creator.id,
},
defaultSort: 'newest',
defaultFilter: 'all',
shouldLoadFromStorage: false,
}}
/>