add: locale to orders page
This commit is contained in:
@@ -6,8 +6,10 @@ import LocationPinIcon from '@/components/icons/LocationPinIcon';
|
|||||||
import PerformantTabRenderer from '@/components/tab/PerformantTabRenderer';
|
import PerformantTabRenderer from '@/components/tab/PerformantTabRenderer';
|
||||||
import TabContainer from '@/components/tab/TabContainer'
|
import TabContainer from '@/components/tab/TabContainer'
|
||||||
import { TabHeader } from '@/components/tab/TabHeader';
|
import { TabHeader } from '@/components/tab/TabHeader';
|
||||||
|
import { Receipt2, ReceiptItem } from 'iconsax-react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const currentOrders = [
|
const currentOrders = [
|
||||||
{
|
{
|
||||||
@@ -101,9 +103,12 @@ const currentOrders = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
function OrdersIndex() {
|
function OrdersIndex() {
|
||||||
|
|
||||||
|
const { t } = useTranslation('orders');
|
||||||
|
|
||||||
const categories = [
|
const categories = [
|
||||||
{ id: 0, title: 'سفارشات فعال', image: '/assets/images/food-image.png' },
|
{ id: 0, title: t('Tab.ActiveOrders'), icon: <ReceiptItem size={22} /> },
|
||||||
{ id: 1, title: 'سفارشات قبلی', image: '/assets/images/food-image.png' }
|
{ id: 1, title: t('Tab.PreviousOrders'), icon: <Receipt2 size={22} /> }
|
||||||
]
|
]
|
||||||
|
|
||||||
const firstTab = () => {
|
const firstTab = () => {
|
||||||
@@ -148,7 +153,7 @@ function OrdersIndex() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button className='mt-6 font-medium!'>پیگیری سفارش</Button>
|
<Button className='mt-6 font-medium!'>{t('Card.TrackOrder')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@@ -159,12 +164,12 @@ function OrdersIndex() {
|
|||||||
<div className='pt-8'>
|
<div className='pt-8'>
|
||||||
<TabContainer>
|
<TabContainer>
|
||||||
<TabHeader
|
<TabHeader
|
||||||
viewRenderer={<PerformantTabRenderer rowHeight={310}>{firstTab()}</PerformantTabRenderer>}
|
viewRenderer={<PerformantTabRenderer rowHeight={320}>{firstTab()}</PerformantTabRenderer>}
|
||||||
title={categories[0].title} imageSrc={categories[0].image}>
|
title={categories[0].title} icon={categories[0].icon}>
|
||||||
</TabHeader>
|
</TabHeader>
|
||||||
<TabHeader
|
<TabHeader
|
||||||
viewRenderer={<PerformantTabRenderer><div>empty</div><div></div></PerformantTabRenderer>}
|
viewRenderer={<PerformantTabRenderer><div>empty</div><div></div></PerformantTabRenderer>}
|
||||||
title={categories[0].title} imageSrc={categories[0].image}>
|
title={categories[1].title} icon={categories[1].icon}>
|
||||||
</TabHeader>
|
</TabHeader>
|
||||||
</TabContainer>
|
</TabContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const metadata: Metadata = {
|
|||||||
description: 'Webapp dashboard'
|
description: 'Webapp dashboard'
|
||||||
}
|
}
|
||||||
|
|
||||||
const i18nNamespaces = ['common', 'menu', 'auth'];
|
const i18nNamespaces = ['common', 'menu', 'orders', 'auth'];
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout({
|
||||||
children,
|
children,
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Tab": {
|
||||||
|
"ActiveOrders": "سفارشات فعال",
|
||||||
|
"PreviousOrders": "سفارشات قبلی"
|
||||||
|
},
|
||||||
|
"Card": {
|
||||||
|
"TrackOrder": "پیگیری سفارش"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user