@@ -128,9 +128,6 @@ const ProductCard: FC
= ({
p={6}
w={'full'}
bg={useColorModeValue('white', 'gray.800')}
- boxShadow={'2xl'}
- rounded={'lg'}
- pos={'relative'}
zIndex={1}>
{process.env.COMMERCE_WISHLIST_ENABLED && (
- }
-
- const ProductCardExtended: FC =({
- product,
- imgProps
- }) => {
-
- const { price } = usePrice({
- amount: product.price.value,
- baseAmount: product.price.retailPrice,
- currencyCode: product.price.currencyCode!,
- })
-
- const placeholderImg = '/product-img-placeholder.svg';
- const IMAGE = product.images[0]?.url || placeholderImg
-
- return (
-
-
-
-
-
-
-
- Brand
-
-
- Nice Chair, pink
-
-
-
- $57
-
-
- $199
-
-
-
-
-
- );
- }
-
- export default ProductCardExtended;
\ No newline at end of file
diff --git a/site/components/search.tsx b/site/components/search.tsx
index 9a3b948f3..ba3d2ac98 100644
--- a/site/components/search.tsx
+++ b/site/components/search.tsx
@@ -9,18 +9,11 @@ import type { Product } from '@commerce/types/product'
import { Layout } from '@components/common'
import { ProductCard } from '@components/product'
-import { Container, Skeleton } from '@components/ui'
+import { Collapse, Container, Skeleton } from '@components/ui'
import useSearch from '@framework/product/use-search'
import rangeMap from '@lib/range-map'
-const SORT = {
- 'trending-desc': 'Trending',
- 'latest-desc': 'Latest arrivals',
- 'price-asc': 'Price: Low to high',
- 'price-desc': 'Price: High to low',
-}
-
import {
filterQuery,
getCategoryPath,
@@ -28,6 +21,11 @@ import {
useSearchMeta,
} from '@lib/search'
import ErrorMessage from './ui/ErrorMessage'
+import NavBarFiltersItem from './common/Navbar/NavBarFiltersItem'
+import filtersData from '../static_data/navBarMenuData.json'
+import { Stack } from '@chakra-ui/react'
+import random from 'lodash.random'
+import CategoryListItem from './common/Category/CategoryListItem'
export default function Search({ categories, brands }: SearchPropsType) {
const [activeFilter, setActiveFilter] = useState('')
@@ -54,6 +52,15 @@ export default function Search({ categories, brands }: SearchPropsType) {
locale,
})
+ const categoriesItems = filtersData.categories[locale as keyof typeof filtersData.categories]
+
+ const SORT = {
+ 'trending-desc': locale === "it" ? "Tendenza" :'Trending',
+ 'latest-desc': locale === "it" ? "Ultimi Arrivi" : 'Latest arrivals',
+ 'price-asc': locale === "it" ? "Prezzo Crescente" : 'Price: Low to high',
+ 'price-desc': locale === "it" ? "Prezzo Decrescente" :'Price: High to low',
+ }
+
if (error) {
return
}
@@ -132,36 +139,12 @@ export default function Search({ categories, brands }: SearchPropsType) {
'block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4'
}
>
- All Categories
+ {locale == "it" ? "Tutte le Categorie" : "All Categories"}
- {categories.map((cat: any) => (
-
-
- handleClick(e, 'categories')}
- className={
- 'block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4'
- }
- >
- {cat.name}
-
-
-
+ {categoriesItems.map((category: any) => (
+
))}
@@ -253,7 +236,7 @@ export default function Search({ categories, brands }: SearchPropsType) {
aria-haspopup="true"
aria-expanded="true"
>
- {sort ? SORT[sort as keyof typeof SORT] : 'Relevance'}
+ {sort ? SORT[sort as keyof typeof SORT] : locale === "it" ? "Rilevanza" : "Relevance"}