From d27fcf65e406fb7fba196fd629124b169672d83b Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Wed, 4 Dec 2024 18:54:44 +0330 Subject: [PATCH] fix:recent orders section optimized --- src/components/order/recent-orders.tsx | 21 +++++++++++---------- src/settings/site.settings.ts | 12 ++++++------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/components/order/recent-orders.tsx b/src/components/order/recent-orders.tsx index a096684..6b99f97 100644 --- a/src/components/order/recent-orders.tsx +++ b/src/components/order/recent-orders.tsx @@ -37,26 +37,27 @@ const RecentOrders = ({ const { t } = useTranslation(); const { alignLeft, alignRight } = useIsRTL(); const rowExpandable = (record: any) => record.children?.length; - + console.log(orders); + const columns = [ { title: t('table:table-item-tracking-number'), - dataIndex: 'tracking_number', + dataIndex: 'transaction_id', key: 'tracking_number', align: alignLeft, width: 200, }, { title: t('table:table-item-customer'), - dataIndex: 'customer', - key: 'name', + dataIndex: 'user_info', + key: 'user', align: alignLeft, width: 250, render: (customer: any) => (
- +
- {customer?.name ? customer?.name : t('common:text-guest')} + {customer?.user ? customer?.user : t('common:text-guest')} {customer?.email} @@ -66,7 +67,7 @@ const RecentOrders = ({ }, { title: t('table:table-item-products'), - dataIndex: 'products', + dataIndex: 'items', key: 'products', align: 'center', render: (products: Product) => {products.length}, @@ -75,7 +76,7 @@ const RecentOrders = ({ { // title: t('table:table-item-order-date'), title: t('table:table-item-order-date'), - dataIndex: 'created_at', + dataIndex: 'created', key: 'created_at', align: 'center', render: (date: string) => { @@ -91,7 +92,7 @@ const RecentOrders = ({ }, { title: t('table:table-item-total'), - dataIndex: 'total', + dataIndex: 'total_price', key: 'total', align: 'center', render: function Render(value: any) { @@ -103,7 +104,7 @@ const RecentOrders = ({ }, { title: t('table:table-item-status'), - dataIndex: 'order_status', + dataIndex: 'status', key: 'order_status', align: 'center', render: (order_status: OrderStatus) => ( diff --git a/src/settings/site.settings.ts b/src/settings/site.settings.ts index c7ecc6b..bd32cba 100644 --- a/src/settings/site.settings.ts +++ b/src/settings/site.settings.ts @@ -38,12 +38,12 @@ export const siteSettings = { icon: 'UserIcon', permission: adminOwnerAndStaffOnly, }, - { - href: Routes.shop.create, - labelTransKey: 'common:text-create-shop', - icon: 'ShopIcon', - permission: adminAndOwnerOnly, - }, + // { + // href: Routes.shop.create, + // labelTransKey: 'common:text-create-shop', + // icon: 'ShopIcon', + // permission: adminAndOwnerOnly, + // }, { href: Routes.settings,