|
|
@ -97,7 +97,7 @@ export function DiscountWidget({ |
|
|
<button |
|
|
<button |
|
|
type="button" |
|
|
type="button" |
|
|
onClick={() => setIsExpanded((prev) => !prev)} |
|
|
onClick={() => setIsExpanded((prev) => !prev)} |
|
|
className="flex w-full items-center justify-between py-3.5 text-left transition-colors cursor-pointer select-none" |
|
|
|
|
|
|
|
|
className="flex w-full items-center justify-between py-3.5 text-start transition-colors cursor-pointer select-none" |
|
|
> |
|
|
> |
|
|
<div className="flex items-center gap-3"> |
|
|
<div className="flex items-center gap-3"> |
|
|
{/* Coupon icon */} |
|
|
{/* Coupon icon */} |
|
|
@ -150,11 +150,11 @@ export function DiscountWidget({ |
|
|
{isExpanded && ( |
|
|
{isExpanded && ( |
|
|
<div className="pt-1 pb-2 w-full"> |
|
|
<div className="pt-1 pb-2 w-full"> |
|
|
<div |
|
|
<div |
|
|
className={`flex h-[52px] w-full items-center rounded-[12px] border bg-white px-4 transition-all ${getBorderAndRing()}`} |
|
|
|
|
|
|
|
|
className={`flex h-[52px] w-full items-center gap-3 rounded-[12px] border bg-white px-4 transition-all ${getBorderAndRing()}`} |
|
|
> |
|
|
> |
|
|
<input |
|
|
<input |
|
|
type="text" |
|
|
type="text" |
|
|
dir="ltr" |
|
|
|
|
|
|
|
|
dir="auto" |
|
|
value={code} |
|
|
value={code} |
|
|
disabled={discountStatus === "loading" || discountResult !== null} |
|
|
disabled={discountStatus === "loading" || discountResult !== null} |
|
|
onChange={(e) => { |
|
|
onChange={(e) => { |
|
|
@ -173,18 +173,18 @@ export function DiscountWidget({ |
|
|
placeholder={ |
|
|
placeholder={ |
|
|
t["Enter discount code..."] || "Enter discount code..." |
|
|
t["Enter discount code..."] || "Enter discount code..." |
|
|
} |
|
|
} |
|
|
className="h-full flex-1 bg-transparent text-[15px] font-medium text-[#181818] outline-none placeholder:text-[#98A2B3] disabled:opacity-70 min-w-0" |
|
|
|
|
|
|
|
|
className="h-full flex-1 bg-transparent text-[15px] font-medium text-[#181818] outline-none placeholder:text-[#98A2B3] text-start placeholder:text-start disabled:opacity-70 min-w-0" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
{discountStatus === "loading" ? ( |
|
|
{discountStatus === "loading" ? ( |
|
|
<div className="shrink-0 pl-3"> |
|
|
|
|
|
|
|
|
<div className="shrink-0"> |
|
|
<div className="size-4.5 animate-spin rounded-full border-2 border-[#F0445B] border-t-transparent" /> |
|
|
<div className="size-4.5 animate-spin rounded-full border-2 border-[#F0445B] border-t-transparent" /> |
|
|
</div> |
|
|
</div> |
|
|
) : discountResult !== null ? ( |
|
|
) : discountResult !== null ? ( |
|
|
<button |
|
|
<button |
|
|
type="button" |
|
|
type="button" |
|
|
onClick={handleClear} |
|
|
onClick={handleClear} |
|
|
className="shrink-0 pl-3 text-[15px] font-semibold text-[#F0445B] hover:opacity-80 transition-opacity cursor-pointer" |
|
|
|
|
|
|
|
|
className="shrink-0 text-[15px] font-semibold text-[#F0445B] hover:opacity-80 transition-opacity cursor-pointer" |
|
|
> |
|
|
> |
|
|
{t["Clear"] || "Clear"} |
|
|
{t["Clear"] || "Clear"} |
|
|
</button> |
|
|
</button> |
|
|
@ -192,7 +192,7 @@ export function DiscountWidget({ |
|
|
<button |
|
|
<button |
|
|
type="button" |
|
|
type="button" |
|
|
onClick={handleApply} |
|
|
onClick={handleApply} |
|
|
className="shrink-0 pl-3 text-[15px] font-semibold text-[#F0445B] hover:opacity-80 transition-opacity cursor-pointer" |
|
|
|
|
|
|
|
|
className="shrink-0 text-[15px] font-semibold text-[#F0445B] hover:opacity-80 transition-opacity cursor-pointer" |
|
|
> |
|
|
> |
|
|
{t["Apply"] || "Apply"} |
|
|
{t["Apply"] || "Apply"} |
|
|
</button> |
|
|
</button> |
|
|
|