redeem: keep intergration
This commit is contained in:
@@ -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}}!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,18 +254,24 @@ export default function RedeemPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<Form form={form}>
|
||||||
style={{
|
<div
|
||||||
margin: "20px 0",
|
style={{
|
||||||
display: "flex",
|
margin: "20px 0",
|
||||||
flexDirection: "column",
|
display: "flex",
|
||||||
gap: 16,
|
flexDirection: "column",
|
||||||
}}
|
gap: 16,
|
||||||
>
|
}}
|
||||||
<GiftItemsCard />
|
>
|
||||||
<VoucherBalanceCard />
|
{redeemDetails?.gift?.gift_type === "ORDER" && <GiftItemsCard />}
|
||||||
<LocationCard />
|
{redeemDetails?.gift?.gift_type === "AMOUNT" && (
|
||||||
</div>
|
<VoucherBalanceCard />
|
||||||
|
)}
|
||||||
|
<LocationCard />
|
||||||
|
<CollectWay />
|
||||||
|
<PickupTimeCard />
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
</Layout.Content>
|
</Layout.Content>
|
||||||
|
|
||||||
<Layout.Footer className={styles.checkoutButtonContainer}>
|
<Layout.Footer className={styles.checkoutButtonContainer}>
|
||||||
|
|||||||
Reference in New Issue
Block a user