mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Improved Categories (#339)
* Improved Categories * Improved Categories * Improved Categories * Improved Categories * Improved Categories * Improved Categories
This commit is contained in:
@@ -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,
|
||||
}
|
||||
)}
|
||||
>
|
||||
|
Reference in New Issue
Block a user