From 1522adf3882b6c765a3aa667e0bc70e1609034a8 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 8 Dec 2025 11:20:02 +0330 Subject: [PATCH] change orders list design --- src/app/[name]/(Main)/order/history/page.tsx | 115 ++++++++++++------- src/components/utils/RateSelectionBar.tsx | 3 +- 2 files changed, 74 insertions(+), 44 deletions(-) diff --git a/src/app/[name]/(Main)/order/history/page.tsx b/src/app/[name]/(Main)/order/history/page.tsx index 05820b4..c0a1790 100644 --- a/src/app/[name]/(Main)/order/history/page.tsx +++ b/src/app/[name]/(Main)/order/history/page.tsx @@ -3,7 +3,6 @@ import Button from '@/components/button/PrimaryButton'; import CalendarIcon from '@/components/icons/CalendarIcon'; import LocationPinIcon from '@/components/icons/LocationPinIcon'; -import PerformantTabRenderer from '@/components/tab/PerformantTabRenderer'; import TabContainer from '@/components/tab/TabContainer' import { TabHeader } from '@/components/tab/TabHeader'; import { Receipt2, ReceiptItem } from 'iconsax-react'; @@ -89,27 +88,42 @@ function OrdersIndex() {
-
-
- {items.map((item) => { - const imageUrl = getFoodImage(item.food.images); - return ( - +
+ {items.map((item) => { + const imageUrl = getFoodImage(item.food.images); + const foodName = item.food.title || 'بدون نام'; + const itemTotalPrice = (item.totalPrice || item.unitPrice * item.quantity).toLocaleString('fa-IR'); + return ( +
+
order image - - {item.quantity} - - - ) - })} -
+
+
+

+ {foodName} +

+
+ + {item.quantity}x + + + {itemTotalPrice} T + +
+
+
+ ); + })} +
+ +
{formattedPrice} T
@@ -149,38 +163,53 @@ function OrdersIndex() {
-
-
- {items.map((item) => { - const imageUrl = getFoodImage(item.food.images); - return ( - +
+ {items.map((item) => { + const imageUrl = getFoodImage(item.food.images); + const foodName = item.food.title || 'بدون نام'; + const itemTotalPrice = (item.totalPrice || item.unitPrice * item.quantity).toLocaleString('fa-IR'); + return ( +
+
order image - - {item.quantity} - - - ) - })} -
+
+
+

+ {foodName} +

+
+ + {item.quantity}x + + + {itemTotalPrice} T + +
+
+ {order.status === 'delivered' && ( + + + + )} +
+ ); + })} +
+ +
{formattedPrice} T
-
- - - - -
+
) @@ -192,12 +221,12 @@ function OrdersIndex() {
{firstTab()}} + viewRenderer={
{firstTab()}
} title={categories[0].title} icon={categories[0].icon} /> {secondTab()}} + viewRenderer={
{secondTab()}
} title={categories[1].title} icon={categories[1].icon} /> diff --git a/src/components/utils/RateSelectionBar.tsx b/src/components/utils/RateSelectionBar.tsx index f658325..c4f0dc2 100644 --- a/src/components/utils/RateSelectionBar.tsx +++ b/src/components/utils/RateSelectionBar.tsx @@ -22,10 +22,11 @@ function RateSelectionBar({ name, content = defaultContent, className = '' }: Pr return (
-