From 6d275e7a06299002fd7e889ef703b5701de94a3e Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 27 Oct 2025 14:46:23 +0330 Subject: [PATCH] fix design bug responsive --- .../components/ShippingMethodSelector.tsx | 58 +++++++++---------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/src/app/cart/components/ShippingMethodSelector.tsx b/src/app/cart/components/ShippingMethodSelector.tsx index f97c819..4796e7d 100644 --- a/src/app/cart/components/ShippingMethodSelector.tsx +++ b/src/app/cart/components/ShippingMethodSelector.tsx @@ -1,7 +1,8 @@ 'use client' -import { useState, useEffect } from 'react' +import { useState } from 'react' +import Image from 'next/image' import { Truck, Sort, Flash } from 'iconsax-react' -import { ShopShippingType, ShipmentInfoType, ShipperType } from '../types/Types' +import { ShopShippingType, ShipperType } from '../types/Types' interface ShippingMethodSelectorProps { shippingData: ShopShippingType[] @@ -51,15 +52,6 @@ const ShippingMethodSelector = ({ }) } - // هندلر تغییر مرتب‌سازی - const handleSortChange = (newSortBy: 'price' | 'time' | 'default') => { - if (sortBy === newSortBy) { - setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc') - } else { - setSortBy(newSortBy) - setSortOrder('asc') - } - } // هندلر toggle محصولات فروشگاه const toggleShopExpansion = (shopId: string) => { @@ -106,7 +98,7 @@ const ShippingMethodSelector = ({ return (
-
+
@@ -125,7 +117,7 @@ const ShippingMethodSelector = ({ )}
-
+
{/* انتخاب سریع */}
@@ -157,7 +149,7 @@ const ShippingMethodSelector = ({ setSortBy(newSortBy) setSortOrder(newSortOrder) }} - className="text-sm border border-gray-300 rounded px-2 py-1 bg-white" + className="text-sm border border-gray-300 rounded px-2 py-1 bg-white min-w-[120px]" > @@ -170,7 +162,7 @@ const ShippingMethodSelector = ({ {onClearSelections && Object.keys(selectedShipments).length > 0 && ( @@ -181,7 +173,7 @@ const ShippingMethodSelector = ({
{shippingData?.map((shop) => (
-
+

{shop.shopName}

@@ -189,7 +181,7 @@ const ShippingMethodSelector = ({

{selectedShipments[shop.shopId] && ( -
+
@@ -217,17 +209,19 @@ const ShippingMethodSelector = ({ {expandedShops.has(shop.shopId) && (
{shop.items?.map((item, index) => ( -
- + {item.product.title_fa} -
-
+
+
{item.product.title_fa}
-
+
تعداد: {item.quantity}
@@ -257,25 +251,25 @@ const ShippingMethodSelector = ({ return (