From 212fda06b5b956e9908c6eb83864990dd589ca8e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 4 Sep 2024 11:07:52 +0700 Subject: update mobile view category --- src/core/components/elements/Sidebar/Sidebar.jsx | 23 +++++++++++++++++------ src/lib/product/components/CategorySection.jsx | 7 ++++--- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/core/components/elements/Sidebar/Sidebar.jsx b/src/core/components/elements/Sidebar/Sidebar.jsx index 55838890..d9c2c533 100644 --- a/src/core/components/elements/Sidebar/Sidebar.jsx +++ b/src/core/components/elements/Sidebar/Sidebar.jsx @@ -5,6 +5,8 @@ import { AnimatePresence, motion } from 'framer-motion' import { ChevronDownIcon, ChevronUpIcon, CogIcon, UserIcon } from '@heroicons/react/24/outline' import { Fragment, useEffect, useState } from 'react' import odooApi from '@/core/api/odooApi' +import { createSlug } from '@/core/utils/slug' +import Image from 'next/image' const Sidebar = ({ active, close }) => { const auth = useAuth() @@ -155,9 +157,12 @@ const Sidebar = ({ active, close }) => {
+
+ +
{category.name}
{ }`} > +
+ +
{child1Category.name} {child1Category.childs.length > 0 && ( @@ -200,9 +208,12 @@ const Sidebar = ({ active, close }) => { child1Category.childs.map((child2Category) => ( +
+ +
{child2Category.name} ))} diff --git a/src/lib/product/components/CategorySection.jsx b/src/lib/product/components/CategorySection.jsx index e8ebb095..a287fa78 100644 --- a/src/lib/product/components/CategorySection.jsx +++ b/src/lib/product/components/CategorySection.jsx @@ -63,7 +63,7 @@ const CategorySection = ({ categories }) => { {isMobile && (
- {displayedCategories.map((category) => ( + {categories.map((category) => (
@@ -74,6 +74,7 @@ const CategorySection = ({ categories }) => { width={56} height={48} alt={category?.name} + className="p-3" />

{category?.name} @@ -85,7 +86,7 @@ const CategorySection = ({ categories }) => { ))} - {categories.length > 10 && ( + {/* {categories.length > 10 && (
- )} + )} */}

)} -- cgit v1.2.3