redeem: keep intergration

This commit is contained in:
2026-01-11 23:44:46 +03:00
parent b0288ebcf6
commit 167b26e0b9
2 changed files with 40 additions and 19 deletions

View File

@@ -583,6 +583,8 @@
"giftedItems": "Gifted Items", "giftedItems": "Gifted Items",
"viewAll": "View All", "viewAll": "View All",
"voucherCodeCopied": "Voucher code copied!", "voucherCodeCopied": "Voucher code copied!",
"copyFailed": "Failed to copy voucher code" "copyFailed": "Failed to copy voucher code",
"hiX": "Hi {{name}}!",
"youHaveReceivedAGiftCarFromX": "You have received a gift car from {{name}}!"
} }
} }

View File

@@ -1,4 +1,13 @@
import { Button, Card, Image, Layout, QRCode, Skeleton, message } from "antd"; import {
Button,
Card,
Form,
Image,
Layout,
QRCode,
Skeleton,
message,
} from "antd";
import ProHeader from "components/ProHeader/ProHeader"; import ProHeader from "components/ProHeader/ProHeader";
import ProText from "components/ProText"; import ProText from "components/ProText";
@@ -12,13 +21,15 @@ import { GiftItemsCard } from "./components/GiftItemsCard.tsx";
import { VoucherBalanceCard } from "./components/VoucherBalanceCard.tsx"; import { VoucherBalanceCard } from "./components/VoucherBalanceCard.tsx";
import { OrderType } from "pages/checkout/hooks/types.ts"; import { OrderType } from "pages/checkout/hooks/types.ts";
import { Loader } from "components/Loader/Loader.tsx"; import { Loader } from "components/Loader/Loader.tsx";
import { CollectWay } from "pages/checkout/components/CollectWay/CollectWay.tsx";
import PickupTimeCard from "pages/checkout/components/pickupEstimate/TimeEstimateCard.tsx";
export default function RedeemPage() { export default function RedeemPage() {
const { t } = useTranslation(); const { t } = useTranslation();
const { voucherId } = useParams(); const { voucherId } = useParams();
const navigate = useNavigate(); const navigate = useNavigate();
const { subdomain } = useParams(); const { subdomain } = useParams();
const [form] = Form.useForm();
const { data: redeemDetails, isLoading } = useGetRedeemDetailsQuery( const { data: redeemDetails, isLoading } = useGetRedeemDetailsQuery(
voucherId || "", voucherId || "",
{ {
@@ -65,12 +76,14 @@ export default function RedeemPage() {
<ProText <ProText
style={{ fontSize: 16, fontWeight: 600, color: "#333333" }} style={{ fontSize: 16, fontWeight: 600, color: "#333333" }}
> >
{t("redeem.addGiftDetails")} {t("redeem.hiX", { name: redeemDetails?.gift?.recipient_name })}
</ProText> </ProText>
<ProText <ProText
style={{ fontSize: 14, fontWeight: 400, color: "#95949C" }} style={{ fontSize: 14, fontWeight: 400, color: "#95949C" }}
> >
{t("redeem.description")} {t("redeem.youHaveReceivedAGiftCarFromX", {
name: redeemDetails?.gift?.sender_name,
})}
</ProText> </ProText>
</div> </div>
@@ -122,7 +135,7 @@ export default function RedeemPage() {
color: "#95949C", color: "#95949C",
}} }}
> >
{t("redeem.description")} {redeemDetails?.gift?.message || t("redeem.description")}
</ProText> </ProText>
<ProText <ProText
style={{ style={{
@@ -135,7 +148,7 @@ export default function RedeemPage() {
color: "#333333", color: "#333333",
}} }}
> >
{t("redeem.addGiftDetails")} {redeemDetails?.gift?.sender_name}
</ProText> </ProText>
</div> </div>
@@ -241,6 +254,7 @@ export default function RedeemPage() {
</div> </div>
</div> </div>
<Form form={form}>
<div <div
style={{ style={{
margin: "20px 0", margin: "20px 0",
@@ -249,10 +263,15 @@ export default function RedeemPage() {
gap: 16, gap: 16,
}} }}
> >
<GiftItemsCard /> {redeemDetails?.gift?.gift_type === "ORDER" && <GiftItemsCard />}
{redeemDetails?.gift?.gift_type === "AMOUNT" && (
<VoucherBalanceCard /> <VoucherBalanceCard />
)}
<LocationCard /> <LocationCard />
<CollectWay />
<PickupTimeCard />
</div> </div>
</Form>
</Layout.Content> </Layout.Content>
<Layout.Footer className={styles.checkoutButtonContainer}> <Layout.Footer className={styles.checkoutButtonContainer}>