From ac3590d30aec0ab7af7f198760ff6d53992a95dc Mon Sep 17 00:00:00 2001 From: iFixKart Dev Date: Mon, 16 Nov 2026 23:21:46 +0530 Subject: [PATCH] feat(mobile): optimize mobile brands carousel, peek category swipe, and touch product cards --- components/ProductCard.tsx | 16 ++++++++-------- sections/BrandsSection.tsx | 27 +++++++++++++++++++-------- sections/CategoriesSection.tsx | 6 +++--- sections/UltimateTechSection.tsx | 2 +- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/components/ProductCard.tsx b/components/ProductCard.tsx index 5a728d6..8e4c10d 100644 --- a/components/ProductCard.tsx +++ b/components/ProductCard.tsx @@ -302,10 +302,10 @@ export const ProductCard: React.FC = ({
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} - className="bg-white p-4 md:p-5 flex flex-col relative font-sans group/card h-full min-h-[380px]" + className="bg-white p-3 sm:p-4 md:p-5 flex flex-col relative font-sans group/card h-full min-h-[330px] sm:min-h-[380px]" > {/* Badges — top right */} -
+
{isOutOfStock ? ( Out of Stock @@ -318,12 +318,12 @@ export const ProductCard: React.FC = ({ ) : null}
- {/* Hover actions — top left */} + {/* Hover actions — top left (always visible on touch/mobile, hover on desktop) */}
-
+
{mainImageUrl ? ( <> = ({
{loading ? ( -
+
{Array.from({ length: 10 }).map((_, i) => ( - +
))}
) : ( -
+
{brands.map((brand) => ( {brand.logo ? ( {brand.name} ) : ( {brand.name} diff --git a/sections/CategoriesSection.tsx b/sections/CategoriesSection.tsx index e4acaea..309df5d 100644 --- a/sections/CategoriesSection.tsx +++ b/sections/CategoriesSection.tsx @@ -280,10 +280,10 @@ export const CategoriesSection: React.FC = ({ nextEl: '.cat-swiper-next', }} watchOverflow - spaceBetween={18} - slidesPerView={2} + spaceBetween={14} + slidesPerView={2.3} breakpoints={{ - 480: { slidesPerView: 3, spaceBetween: 18 }, + 480: { slidesPerView: 3, spaceBetween: 16 }, 768: { slidesPerView: 4, spaceBetween: 20 }, 1024: { slidesPerView: 5, spaceBetween: 22 }, 1280: { slidesPerView: 6, spaceBetween: 24 }, diff --git a/sections/UltimateTechSection.tsx b/sections/UltimateTechSection.tsx index f654c26..1392104 100644 --- a/sections/UltimateTechSection.tsx +++ b/sections/UltimateTechSection.tsx @@ -216,7 +216,7 @@ export const UltimateTechSection: React.FC = ({ idx < 2 ? 'border-b md:border-b-0' : '', ].join(' ')} > - +
))}