Add used-product flag for store listings.
Merchants can mark items as used on create/edit, see a used badge on cards, and filter the store list for used products. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
32f0dbab63
commit
61d145d92e
@@ -76,6 +76,7 @@ function StoreItemsPageContent() {
|
||||
const [draftMinPrice, setDraftMinPrice] = useState('')
|
||||
const [draftMaxPrice, setDraftMaxPrice] = useState('')
|
||||
const [draftOnlyDiscounted, setDraftOnlyDiscounted] = useState(false)
|
||||
const [draftOnlyUsed, setDraftOnlyUsed] = useState(false)
|
||||
const [appliedFilters, setAppliedFilters] = useState<StoreListingFilters>(
|
||||
EMPTY_STORE_LISTING_FILTERS,
|
||||
)
|
||||
@@ -156,6 +157,7 @@ function StoreItemsPageContent() {
|
||||
minPrice: parseIrtInput(draftMinPrice),
|
||||
maxPrice: parseIrtInput(draftMaxPrice),
|
||||
onlyDiscounted: draftOnlyDiscounted,
|
||||
onlyUsed: draftOnlyUsed,
|
||||
})
|
||||
writePage(1)
|
||||
}
|
||||
@@ -165,6 +167,7 @@ function StoreItemsPageContent() {
|
||||
setDraftMinPrice('')
|
||||
setDraftMaxPrice('')
|
||||
setDraftOnlyDiscounted(false)
|
||||
setDraftOnlyUsed(false)
|
||||
setAppliedFilters(EMPTY_STORE_LISTING_FILTERS)
|
||||
writePage(1)
|
||||
}
|
||||
@@ -415,6 +418,22 @@ function StoreItemsPageContent() {
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${filterStyles.switchField} ${filterStyles.fieldCol3}`}>
|
||||
<div className={filterStyles.switchInline}>
|
||||
<ToggleSwitch
|
||||
checked={draftOnlyUsed}
|
||||
onChange={setDraftOnlyUsed}
|
||||
disabled={isLoading}
|
||||
ariaLabel={t('storeItems.onlyUsed')}
|
||||
/>
|
||||
<span
|
||||
className={filterStyles.switchLabel}
|
||||
onClick={() => !isLoading && setDraftOnlyUsed(!draftOnlyUsed)}
|
||||
>
|
||||
{t('storeItems.onlyUsed')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={filterStyles.filterActions}>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user