From af2cf4bbc8bafece7cb85203c13f80b94152a1ee Mon Sep 17 00:00:00 2001 From: minsoeaung Date: Fri, 22 Dec 2023 17:03:24 +0630 Subject: [PATCH] Fix date time not showing in review item & improve header ui --- Client/src/components/Header.tsx | 132 +++++++++++++-------- Client/src/components/ProductFilters.tsx | 6 +- Client/src/components/ProductSortBy.tsx | 12 +- Client/src/components/Products/index.tsx | 2 +- Client/src/components/ReviewItem.tsx | 2 +- Client/src/pages/Catalog/ProductDetail.tsx | 1 + Client/src/pages/User/MyOrders/index.tsx | 2 +- 7 files changed, 102 insertions(+), 55 deletions(-) diff --git a/Client/src/components/Header.tsx b/Client/src/components/Header.tsx index 91e7fb5..3d3d033 100644 --- a/Client/src/components/Header.tsx +++ b/Client/src/components/Header.tsx @@ -37,6 +37,7 @@ import { useAuth } from '../context/AuthContext.tsx'; import { IoDocumentTextOutline } from 'react-icons/io5'; import { useWishList } from '../hooks/queries/useWishList.ts'; import { useMyAccount } from '../hooks/queries/useMyAccount.ts'; +import { FaRegHeart } from 'react-icons/fa'; const Header = () => { const { colorMode, toggleColorMode } = useColorMode(); @@ -108,51 +109,65 @@ const Header = () => { - } - onClick={onOpen} - size={{ base: 'sm', md: 'md' }} - /> + } onClick={onOpen} /> : } onClick={toggleColorMode} - size={{ base: 'sm', md: 'md' }} /> - {user && !isMobile && ( - - )} + {user && + (isMobile ? ( + + } + /> + {Array.isArray(wishList) && wishList.length > 0 && ( + + {wishList.length} + + )} + + ) : ( + + ))} {!user && ( <> @@ -179,7 +194,29 @@ const Header = () => { {user && ( <> - {!isMobile && ( + {isMobile ? ( + + } + /> + {Array.isArray(cart?.cartItems) && cart!.cartItems.length > 0 && ( + + {cart!.cartItems.length} + + )} + + ) : ( diff --git a/Client/src/pages/User/MyOrders/index.tsx b/Client/src/pages/User/MyOrders/index.tsx index 8164cad..a7a3f67 100644 --- a/Client/src/pages/User/MyOrders/index.tsx +++ b/Client/src/pages/User/MyOrders/index.tsx @@ -91,7 +91,7 @@ const MyOrdersPage = () => { {item.id} {new Date(item.createdAt) - .toLocaleDateString('my-MM', { + .toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long',