pay flow: initial commit

This commit is contained in:
2025-12-03 01:31:30 +03:00
parent 359d7820dd
commit c43708be6d
12 changed files with 148 additions and 17 deletions

66
src/pages/pay/page.tsx Normal file
View File

@@ -0,0 +1,66 @@
import { Form, Layout } from "antd";
import InputCard from "components/InputCard";
import OrderSummary from "components/OrderSummary/OrderSummary";
import PaymentMethods from "components/PaymentMethods/PaymentMethods";
import ProHeader from "components/ProHeader/ProHeader";
import { selectCart } from "features/order/orderSlice";
import { AddressSummary } from "pages/checkout/components/AddressSummary";
import BriefMenu from "pages/checkout/components/BriefMenu";
import CheckoutButton from "pages/checkout/components/CheckoutButton";
import { GiftCard } from "pages/checkout/components/GiftCard";
import PhoneCard from "pages/checkout/components/phoneCard";
import { OrderType } from "pages/checkout/hooks/types";
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";
import styles from "../address/address.module.css";
export default function PayPage() {
const { t } = useTranslation();
const [form] = Form.useForm();
const { phone, order, orderType } = useAppSelector(selectCart);
return (
<>
<Form
form={form}
initialValues={{
phone,
}}
layout="vertical"
>
<Layout>
<ProHeader>{t("pay.title")}</ProHeader>
<Layout.Content className={styles.checkoutContainer}>
<AddressSummary />
{orderType === OrderType.ToRoom && (
<InputCard
title={t("address.roomNo")}
name="roomNumber"
placeholder={t("address.roomNo")}
value={order?.roomNumber}
/>
)}
{orderType === OrderType.ToOffice && (
<InputCard
title={t("address.officeNo")}
name="officeNumber"
placeholder={t("address.officeNo")}
value={order?.officeNumber}
/>
)}
{orderType === OrderType.Gift && <GiftCard />}
{/* <RoomDetails />
<OfficeDetails /> */}
{/* <GiftDetails /> */}
<BriefMenu />
<OrderSummary />
<PhoneCard />
<PaymentMethods />
</Layout.Content>
<CheckoutButton form={form} />
</Layout>
</Form>
</>
);
}