diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-10-20 08:07:07 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-10-20 08:07:07 +0000 |
| commit | 1694c12f75ad06c5e40d6f9a66e245c3e683146c (patch) | |
| tree | eb8ea6d4b751bb13f2f1751f472dee240ec9c048 /src | |
| parent | 588f822e60182cecfaed5a48d00d710892dfc7ae (diff) | |
| parent | 4310c68248520d265879fbc0a2fc094f7f3e3b52 (diff) | |
Merged in CR/UI (pull request #109)
feedback testing - filter by brand (ada brand lain yang ikut)
Diffstat (limited to 'src')
| -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 || []} |
