diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-20 15:06:08 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-20 15:06:08 +0700 |
| commit | 4310c68248520d265879fbc0a2fc094f7f3e3b52 (patch) | |
| tree | 18346cfb9decdcedf8740a67c3c674ebf8b7ff38 /src/lib | |
| parent | 85e0a7e47db518fb5fb2531b2ea7c6d50408875f (diff) | |
feedback testing - filter by brand (ada brand lain yang ikut)
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/product/components/ProductSearch.jsx | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index 630e3a74..d094a25b 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -28,7 +28,7 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) if (defaultBrand) query.brand = defaultBrand.toLowerCase() const { productSearch } = useProductSearch({ query: { ...query, q, limit, orderBy }, - operation: router?.pathname?.includes('brands') ? 'OR' : 'AND' + operation: 'OR' }) const [products, setProducts] = useState(null) const [spellings, setSpellings] = useState(null) @@ -295,21 +295,24 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) <DesktopView> <div className='container mx-auto flex mb-3'> <div className='w-3/12'> - <div className='p-4'> - <div className='text-caption-1 text-gray_r-11 mb-2'>Produk dari brand:</div> - {brand?.data?.logo && ( - <Image - src={brand?.data?.logo} - alt={brand?.data?.name} - className='w-32 p-2 border borde-gray_r-6 rounded' - /> - )} - {!brand?.data?.logo && ( - <div className='bg-danger-500 text-white text-center text-body-1 py-2 px-4 rounded w-fit'> - {brand?.data?.name} - </div> - )} - </div> + {brand && ( + <div className='p-4'> + <div className='text-caption-1 text-gray_r-11 mb-2'>Produk dari brand:</div> + {brand?.data?.logo && ( + <Image + src={brand?.data?.logo} + alt={brand?.data?.name} + className='w-32 p-2 border borde-gray_r-6 rounded' + /> + )} + {!brand?.data?.logo && ( + <div className='bg-danger-500 text-white text-center text-body-1 py-2 px-4 rounded w-fit'> + {brand?.data?.name} + </div> + )} + </div> + )} + <ProductFilterDesktop brands={brands || []} categories={categories || []} |
