From 949a03f9a12b17fad85ecc58baad6352ba98d04d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 27 Mar 2023 13:41:19 +0700 Subject: fix dark mode --- .../product/components/ProductFilterDesktop.jsx | 54 ++++++++------------- src/lib/product/components/ProductSearch.jsx | 56 ++++++---------------- 2 files changed, 34 insertions(+), 76 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductFilterDesktop.jsx b/src/lib/product/components/ProductFilterDesktop.jsx index 276a7cc9..e430ac58 100644 --- a/src/lib/product/components/ProductFilterDesktop.jsx +++ b/src/lib/product/components/ProductFilterDesktop.jsx @@ -1,9 +1,8 @@ -import BottomPopup from '@/core/components/elements/Popup/BottomPopup' import { useRouter } from 'next/router' import { useState } from 'react' import _ from 'lodash' import { toQuery } from 'lodash-contrib' -import { Accordion, Badge, Checkbox, Label, TextInput } from 'flowbite-react' +import { Accordion, Checkbox, Label, TextInput } from 'flowbite-react' const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = null }) => { const router = useRouter() @@ -51,29 +50,22 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu return ( <> - + Kategori - -
+ +
{categories.map((category, index) => ( -
+
- - {/*
250
*/} +
))}
@@ -82,24 +74,20 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu {!defaultBrand && ( <> - Brand - -
+ Brand + +
{brands.map((brand, index) => ( -
+
- - {/*
250
*/} +
))}
@@ -108,7 +96,7 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu )} - Harga + Harga
-
diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index 3078eac5..b5d7c974 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -10,7 +10,6 @@ import useActive from '@/core/hooks/useActive' import MobileView from '@/core/components/views/MobileView' import DesktopView from '@/core/components/views/DesktopView' import NextImage from 'next/image' -import { ChevronDownIcon } from '@heroicons/react/24/outline' import ProductFilterDesktop from './ProductFilterDesktop' import { useRouter } from 'next/router' @@ -43,7 +42,6 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { ) const [open, setOpen] = useState(1) - const [order, setOrder] = useState(query?.orderBy) const handleOpen = (value) => { setOpen(open === value ? 0 : value) @@ -55,15 +53,15 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { { value: 'stock', label: 'Ready Stock' } ] - const handleOrderBy = (e) => { + const handleOrderBy = (e) => { let params = { ...router.query, - orderBy: e.target.value - } - params = _.pickBy(params, _.identity) - params = toQuery(params) - router.push(`${prefixUrl}?${params}`) - } + orderBy: e.target.value + } + params = _.pickBy(params, _.identity) + params = toQuery(params) + router.push(`${prefixUrl}?${params}`) + } useEffect(() => { if (!products) { @@ -109,21 +107,13 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { )}
-
{products && - products.map((product) => ( - - ))} + products.map((product) => )}
{ )}
- {/*
- -
*/}
@@ -211,12 +193,7 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => {
{products && - products.map((product) => ( - - ))} + products.map((product) => )}
@@ -229,10 +206,7 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => {
Barang yang anda cari tidak ada?{' '} - + Hubungi Kami -- cgit v1.2.3