Browse Source

fix:recent orders section optimized

master
sina_sajjadi 3 weeks ago
parent
commit
d27fcf65e4
  1. 21
      src/components/order/recent-orders.tsx
  2. 12
      src/settings/site.settings.ts

21
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) => (
<div className="flex items-center">
<Avatar name={customer?.name} />
<Avatar name={customer?.user} />
<div className="flex flex-col whitespace-nowrap font-medium ms-2">
{customer?.name ? customer?.name : t('common:text-guest')}
{customer?.user ? customer?.user : t('common:text-guest')}
<span className="text-[13px] font-normal text-gray-500/80">
{customer?.email}
</span>
@ -66,7 +67,7 @@ const RecentOrders = ({
},
{
title: t('table:table-item-products'),
dataIndex: 'products',
dataIndex: 'items',
key: 'products',
align: 'center',
render: (products: Product) => <span>{products.length}</span>,
@ -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) => (

12
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,

Loading…
Cancel
Save