gift: enhance items flow

This commit is contained in:
2026-01-12 00:18:55 +03:00
parent 167b26e0b9
commit f988fd3a4e
6 changed files with 70 additions and 55 deletions

View File

@@ -15,6 +15,7 @@ import { useMemo, useState } from "react";
import CardAmountIcon from "components/Icons/CardAmountIcon";
import ArabicPrice from "components/ArabicPrice";
import { GiftAmountBottomSheet } from "pages/CardDetails/components/GiftAmountBottomSheet";
import { GiftType } from "components/CustomBottomSheet/GiftTypeBottomSheet";
export function GiftCard() {
const { t } = useTranslation();
@@ -32,6 +33,8 @@ export function GiftCard() {
const [isGiftAmountBottomSheetOpen, setIsGiftAmountBottomSheetOpen] =
useState(false);
console.log(giftDetails?.giftType);
return (
<>
<ProInputCard title={t("address.giftDetails")}>
@@ -108,10 +111,12 @@ export function GiftCard() {
</div>
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
</div>
<Divider style={{ margin: "10px 0" }} />
{giftDetails?.giftType === "vouchers" ||
(giftDetails?.giftType === "itemsAndVouchers" && (
{(giftDetails?.giftType === GiftType.Vouchers ||
giftDetails?.giftType === GiftType.ItemsAndVouchers) && (
<>
<div
className={styles.orderNotes}
onClick={() => {
@@ -164,46 +169,49 @@ export function GiftCard() {
</div>
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
</div>
))}
{giftDetails?.giftType === GiftType.ItemsAndVouchers && (
<Divider style={{ margin: "10px 0" }} />
)}
</>
)}
<Divider style={{ margin: "10px 0" }} />
{giftDetails?.giftType === "items" ||
(giftDetails?.giftType === "itemsAndVouchers" && (
<div
{(giftDetails?.giftType === GiftType.Items ||
giftDetails?.giftType === GiftType.ItemsAndVouchers) && (
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
}}
onClick={() => {
navigate(`/${subdomain}/cart`);
}}
>
<ProText
style={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
}}
onClick={() => {
navigate(`/${subdomain}/cart`);
fontWeight: 400,
fontStyle: "Regular",
fontSize: 12,
lineHeight: "140%",
letterSpacing: "0%",
color: "#777580",
cursor: "pointer",
}}
>
<ProText
<span
style={{
fontWeight: 400,
fontStyle: "Regular",
fontSize: 12,
lineHeight: "140%",
letterSpacing: "0%",
color: "#777580",
cursor: "pointer",
[isRTL ? "marginLeft" : "marginRight"]: 5,
position: "relative",
top: 3.5,
}}
>
<span
style={{
[isRTL ? "marginLeft" : "marginRight"]: 5,
position: "relative",
top: 3.5,
}}
>
<InvoiceIcon />
</span>
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
</ProText>
{isRTL ? <BackIcon /> : <NextIcon />}
</div>
))}
<InvoiceIcon />
</span>
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
</ProText>
{isRTL ? <BackIcon /> : <NextIcon />}
</div>
)}
</ProInputCard>
<GiftAmountBottomSheet
isOpen={isGiftAmountBottomSheetOpen}