forked from crowetic/commerce
Update SORT object to access from filter button on mobile (#194)
This commit is contained in:
parent
e8b577b83f
commit
0603b342be
@ -14,12 +14,12 @@ import useSearch from '@framework/product/use-search'
|
|||||||
import getSlug from '@lib/get-slug'
|
import getSlug from '@lib/get-slug'
|
||||||
import rangeMap from '@lib/range-map'
|
import rangeMap from '@lib/range-map'
|
||||||
|
|
||||||
const SORT = Object.entries({
|
const SORT = {
|
||||||
'trending-desc': 'Trending',
|
'trending-desc': 'Trending',
|
||||||
'latest-desc': 'Latest arrivals',
|
'latest-desc': 'Latest arrivals',
|
||||||
'price-asc': 'Price: Low to high',
|
'price-asc': 'Price: Low to high',
|
||||||
'price-desc': 'Price: High to low',
|
'price-desc': 'Price: High to low',
|
||||||
})
|
}
|
||||||
|
|
||||||
import {
|
import {
|
||||||
filterQuery,
|
filterQuery,
|
||||||
@ -351,7 +351,7 @@ export default function Search({ categories, brands }: SearchPropsType) {
|
|||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="true"
|
aria-expanded="true"
|
||||||
>
|
>
|
||||||
{sort ? `Sort: ${sort}` : 'Relevance'}
|
{sort ? SORT[sort as keyof typeof SORT] : 'Relevance'}
|
||||||
<svg
|
<svg
|
||||||
className="-mr-1 ml-2 h-5 w-5"
|
className="-mr-1 ml-2 h-5 w-5"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@ -398,7 +398,7 @@ export default function Search({ categories, brands }: SearchPropsType) {
|
|||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{SORT.map(([key, text]) => (
|
{Object.entries(SORT).map(([key, text]) => (
|
||||||
<li
|
<li
|
||||||
key={key}
|
key={key}
|
||||||
className={cn(
|
className={cn(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user