From cb9063bbef1b432482d793ca8dc088d8151c0001 Mon Sep 17 00:00:00 2001 From: Guillermo Angulo Date: Fri, 5 Feb 2021 19:03:28 -0300 Subject: [PATCH] Update SORT object to access from filter button on mobile --- components/search.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/search.tsx b/components/search.tsx index 10fd5df68..36ee14b42 100644 --- a/components/search.tsx +++ b/components/search.tsx @@ -14,12 +14,12 @@ import useSearch from '@framework/product/use-search' import getSlug from '@lib/get-slug' import rangeMap from '@lib/range-map' -const SORT = Object.entries({ +const SORT = { 'trending-desc': 'Trending', 'latest-desc': 'Latest arrivals', 'price-asc': 'Price: Low to high', 'price-desc': 'Price: High to low', -}) +} import { filterQuery, @@ -351,7 +351,7 @@ export default function Search({ categories, brands }: SearchPropsType) { aria-haspopup="true" aria-expanded="true" > - {sort ? `Sort: ${sort}` : 'Relevance'} + {sort ? SORT[sort as keyof typeof SORT] : 'Relevance'} - {SORT.map(([key, text]) => ( + {Object.entries(SORT).map(([key, text]) => (