fix problem

This commit is contained in:
hamid zarghami
2025-12-18 09:54:43 +03:30
parent 9e26173da7
commit 1c39e9c6b3
@@ -2,7 +2,7 @@
import InputField from '@/components/input/InputField';
import clsx from 'clsx';
import { Cup, Icon, TickCircle, Ticket, Trash } from 'iconsax-react';
import { TickCircle, Trash } from 'iconsax-react';
import { useTranslation } from 'react-i18next';
import { useApplyCoupon, useRemoveCoupon } from '../../hooks/useOrderData';
import Button from '@/components/button/PrimaryButton';
@@ -20,10 +20,8 @@ type CouponSectionProps = {
};
export const CouponSection = ({
couponType,
couponCode,
couponCodeError,
onCouponTypeChange,
onCouponCodeChange,
}: CouponSectionProps) => {
@@ -32,10 +30,6 @@ export const CouponSection = ({
const { mutate: removeCoupon, isPending: isRemoving } = useRemoveCoupon();
const { data: cartItems } = useGetCartItems();
const [isApplied, setIsApplied] = useState<boolean>(false);
const couponOptions: Array<{ id: string, label: string, icon: Icon }> = [
{ id: '0', label: t("SectionCoupon.InputCouponType.Options.Discount"), icon: Cup },
{ id: '1', label: t("SectionCoupon.InputCouponType.Options.GiftCard"), icon: Ticket },
];
const handleApplyCoupon = () => {
applyCoupon(couponCode, {
@@ -84,7 +78,7 @@ export const CouponSection = ({
<h3 className="text-sm2 font-medium leading-5">{t("SectionCoupon.Title")}</h3>
<div className='flex flex-col gap-5 mt-6'>
{couponOptions.map(({ id, label, icon: Icon }) => (
{/* {couponOptions.map(({ id, label, icon: Icon }) => (
<div key={id} className='flex items-center'>
<label className='flex items-center gap-2 w-full' htmlFor={`couponType${id}`}>
<Icon
@@ -103,7 +97,7 @@ export const CouponSection = ({
id={`couponType${id}`}
className='size-4 accent-primary' />
</div>
))}
))} */}
</div>
{isApplied ? (
@@ -127,7 +121,7 @@ export const CouponSection = ({
<InputField
autoComplete='off'
className={clsx(
'relative mt-6',
'relative',
couponCodeError.trim() === 'valid' && 'text-emerald-400 **:stroke-emerald-400 ring ring-emerald-400'
)}
placeholder={t("SectionCoupon.InputCouponCode.Placeholder")}