add: cart page locale

This commit is contained in:
Mahyar Khanbolooki
2025-07-30 01:10:14 +03:30
parent 0c41316411
commit 118daf7cc0
3 changed files with 38 additions and 20 deletions
+16 -9
View File
@@ -1,17 +1,20 @@
'use client'; 'use client';
import Button from '@/components/button/PrimaryButton'; import Button from '@/components/button/PrimaryButton';
import { ScrollArea } from '@/components/ui/scrollarea';
import { useReceiptStore } from '@/zustand/receiptStore'; import { useReceiptStore } from '@/zustand/receiptStore';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { ArrowLeft, Trash } from 'iconsax-react'; import { ArrowLeft, Trash } from 'iconsax-react';
import { PlusIcon, MinusIcon } from 'lucide-react'; import { PlusIcon, MinusIcon } from 'lucide-react';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next';
type Props = object type Props = object
const CartIndex = ({ }: Props) => { const CartIndex = ({ }: Props) => {
const { t } = useTranslation('parallels', {
keyPrefix: 'Cart'
});
const router = useRouter(); const router = useRouter();
const quantity = useReceiptStore(state => state.items[0]?.quantity || 0); const quantity = useReceiptStore(state => state.items[0]?.quantity || 0);
const increment = useReceiptStore(state => state.increment); const increment = useReceiptStore(state => state.increment);
@@ -27,7 +30,7 @@ const CartIndex = ({ }: Props) => {
color='currentColor' color='currentColor'
onClick={() => { router.back() }} onClick={() => { router.back() }}
/> />
سبد خرید {t('Heading')}
<ArrowLeft <ArrowLeft
className='cursor-pointer' className='cursor-pointer'
size='24' size='24'
@@ -91,12 +94,14 @@ const CartIndex = ({ }: Props) => {
<div> <div>
<div className='relative'> <div className='relative'>
<h3 className='text-sm'>توضیحات:</h3> <h3 className='text-sm'>
{t('InputDescription.Label')}
</h3>
<textarea <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' 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='' placeholder={t('InputDescription.Placeholder')}
id='report-description' id='description'
name='report-description' name='description'
></textarea> ></textarea>
<span className='absolute top-4 right-2 px-2 bg-background text-foreground text-xs'> <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-cols-2 pt-4'>
<div className='grid grid-rows-2'> <div className='grid grid-rows-2'>
<div className='text-xs'>جمع خرید:</div> <div className='text-xs'>{t('SumOfItemsLabel')}</div>
<div className="text-sm font-medium">560.000 تومان</div> <div className="text-sm font-medium">{t('SumOfItemsValue').replace('{price}', '560.000')}</div>
</div> </div>
<Button>مشاهده فاکتور و پرداخت</Button> <Button>
{t('ButtonCheckout')}
</Button>
</div> </div>
</div> </div>
+1 -1
View File
@@ -42,7 +42,7 @@ function BottomNavBar() {
<nav <nav
className="h-full px-2 grid grid-cols-5 gap-x-2 text-[10px] items-end" 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')} /> <BottomNavLink href={`/${name}/pager`} icon={<PagerIcon width={20} height={20} />} value={t('Pager')} />
<BottomNavHighlightLink <BottomNavHighlightLink
href={`/${name}`} href={`/${name}`}
+11
View File
@@ -11,5 +11,16 @@
"Placeholder": "توضیحات خود را وارد کنید" "Placeholder": "توضیحات خود را وارد کنید"
}, },
"ButtonSubmit": "ثبت" "ButtonSubmit": "ثبت"
},
"Cart": {
"Heading": "سبد خرید",
"Description": "",
"InputDescription": {
"Label": "توضیحات",
"Placeholder": ""
},
"SumOfItemsLabel": "جمع خرید:",
"SumOfItemsValue": "{price} تومان",
"ButtonCheckout": "مشاهده فاکتور و پرداخت"
} }
} }