add: cart page locale
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
'use client';
|
||||
|
||||
import Button from '@/components/button/PrimaryButton';
|
||||
import { ScrollArea } from '@/components/ui/scrollarea';
|
||||
import { useReceiptStore } from '@/zustand/receiptStore';
|
||||
import { motion } from 'framer-motion';
|
||||
import { ArrowLeft, Trash } from 'iconsax-react';
|
||||
import { PlusIcon, MinusIcon } from 'lucide-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
type Props = object
|
||||
|
||||
const CartIndex = ({ }: Props) => {
|
||||
const { t } = useTranslation('parallels', {
|
||||
keyPrefix: 'Cart'
|
||||
});
|
||||
const router = useRouter();
|
||||
const quantity = useReceiptStore(state => state.items[0]?.quantity || 0);
|
||||
const increment = useReceiptStore(state => state.increment);
|
||||
@@ -22,18 +25,18 @@ const CartIndex = ({ }: Props) => {
|
||||
<div className='absolute top-0 left-0 bg-container bottom-0 flex flex-col px-4 pt-10 right-0 z-[100] h-full'>
|
||||
<h1 className='text-lg flex justify-between items-center pb-10'>
|
||||
<Trash
|
||||
className='cursor-pointer'
|
||||
size='24'
|
||||
color='currentColor'
|
||||
onClick={() => { router.back() }}
|
||||
/>
|
||||
سبد خرید
|
||||
className='cursor-pointer'
|
||||
size='24'
|
||||
color='currentColor'
|
||||
onClick={() => { router.back() }}
|
||||
/>
|
||||
{t('Heading')}
|
||||
<ArrowLeft
|
||||
className='cursor-pointer'
|
||||
size='24'
|
||||
color='currentColor'
|
||||
onClick={() => { router.back() }}
|
||||
/>
|
||||
className='cursor-pointer'
|
||||
size='24'
|
||||
color='currentColor'
|
||||
onClick={() => { router.back() }}
|
||||
/>
|
||||
</h1>
|
||||
|
||||
<div className='flex overflow-y-auto noscrollbar flex-col h-full py-4 ' dir='rtl'>
|
||||
@@ -91,12 +94,14 @@ const CartIndex = ({ }: Props) => {
|
||||
|
||||
<div>
|
||||
<div className='relative'>
|
||||
<h3 className='text-sm'>توضیحات:</h3>
|
||||
<h3 className='text-sm'>
|
||||
{t('InputDescription.Label')}
|
||||
</h3>
|
||||
<textarea
|
||||
className='w-full px-4 py-2.5 mt-4 text-sm2 leading-6 outline-0 border border-border rounded-normal resize-none focus:ring-0'
|
||||
placeholder=''
|
||||
id='report-description'
|
||||
name='report-description'
|
||||
placeholder={t('InputDescription.Placeholder')}
|
||||
id='description'
|
||||
name='description'
|
||||
></textarea>
|
||||
<span className='absolute top-4 right-2 px-2 bg-background text-foreground text-xs'>
|
||||
|
||||
@@ -106,10 +111,12 @@ const CartIndex = ({ }: Props) => {
|
||||
|
||||
<div className='grid grid-cols-2 pt-4'>
|
||||
<div className='grid grid-rows-2'>
|
||||
<div className='text-xs'>جمع خرید:</div>
|
||||
<div className="text-sm font-medium">560.000 تومان</div>
|
||||
<div className='text-xs'>{t('SumOfItemsLabel')}</div>
|
||||
<div className="text-sm font-medium">{t('SumOfItemsValue').replace('{price}', '560.000')}</div>
|
||||
</div>
|
||||
<Button>مشاهده فاکتور و پرداخت</Button>
|
||||
<Button>
|
||||
{t('ButtonCheckout')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ function BottomNavBar() {
|
||||
<nav
|
||||
className="h-full px-2 grid grid-cols-5 gap-x-2 text-[10px] items-end"
|
||||
>
|
||||
<BottomNavLink href={`/${name}/orders`} icon={<BagIcon width={20} height={20} />} value={t('Cart')} />
|
||||
<BottomNavLink href={`/${name}/cart`} icon={<BagIcon width={20} height={20} />} value={t('Cart')} />
|
||||
<BottomNavLink href={`/${name}/pager`} icon={<PagerIcon width={20} height={20} />} value={t('Pager')} />
|
||||
<BottomNavHighlightLink
|
||||
href={`/${name}`}
|
||||
|
||||
@@ -11,5 +11,16 @@
|
||||
"Placeholder": "توضیحات خود را وارد کنید"
|
||||
},
|
||||
"ButtonSubmit": "ثبت"
|
||||
},
|
||||
"Cart": {
|
||||
"Heading": "سبد خرید",
|
||||
"Description": "",
|
||||
"InputDescription": {
|
||||
"Label": "توضیحات",
|
||||
"Placeholder": ""
|
||||
},
|
||||
"SumOfItemsLabel": "جمع خرید:",
|
||||
"SumOfItemsValue": "{price} تومان",
|
||||
"ButtonCheckout": "مشاهده فاکتور و پرداخت"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user