Improved Categories (#339)

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories

* Improved Categories
This commit is contained in:
B
2021-05-31 19:44:08 -03:00
committed by GitHub
parent 84a72718d2
commit 1bc721de83
19 changed files with 94 additions and 88 deletions

View File

@@ -13,12 +13,9 @@ import useSearch from '@framework/product/use-search'
import getAllPages from '@framework/common/get-all-pages'
import getSiteInfo from '@framework/common/get-site-info'
import getSlug from '@lib/get-slug'
import rangeMap from '@lib/range-map'
// TODO(bc) Remove this. This should come from the API
import getSlug from '@lib/get-slug'
// TODO (bc) : Remove or standarize this.
const SORT = Object.entries({
'latest-desc': 'Latest arrivals',
'trending-desc': 'Trending',
@@ -75,7 +72,7 @@ export default function Search({
const { data } = useSearch({
search: typeof q === 'string' ? q : '',
categoryId: activeCategory?.entityId,
categoryId: activeCategory?.id,
brandId: (activeBrand as any)?.entityId,
sort: typeof sort === 'string' ? sort : '',
})
@@ -164,8 +161,7 @@ export default function Search({
className={cn(
'block text-sm leading-5 text-gray-700 hover:bg-gray-100 lg:hover:bg-transparent hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900',
{
underline:
activeCategory?.entityId === cat.entityId,
underline: activeCategory?.id === cat.id,
}
)}
>