pay flow: initial commit
This commit is contained in:
@@ -3,16 +3,19 @@ import ArabicPrice from "components/ArabicPrice";
|
||||
import ProInputCard from "components/ProInputCard/ProInputCard";
|
||||
import ProText from "components/ProText";
|
||||
import { selectCart } from "features/order/orderSlice";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import { colors } from "ThemeConstants";
|
||||
import styles from "../../address/address.module.css";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
|
||||
export default function BriefMenu() {
|
||||
const { tables, items } = useAppSelector(selectCart);
|
||||
const { t } = useTranslation();
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
const { subdomain } = useParams();
|
||||
|
||||
const menuItems = useMemo(
|
||||
() =>
|
||||
@@ -46,7 +49,18 @@ export default function BriefMenu() {
|
||||
);
|
||||
|
||||
return (
|
||||
<ProInputCard title={cardTitle}>
|
||||
<ProInputCard
|
||||
title={cardTitle}
|
||||
titleRight={
|
||||
orderType === OrderType.Pay ? (
|
||||
<Link to={`/${subdomain}/menu?orderType=${OrderType.Pay}`} style={{ textDecoration: "none" }}>
|
||||
<ProText style={{ color: colors.primary }}>
|
||||
{t("menu.title")}
|
||||
</ProText>
|
||||
</Link>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
<div className={styles.briefMenuContainer}>{menuItems}</div>
|
||||
</ProInputCard>
|
||||
);
|
||||
|
||||
@@ -246,4 +246,5 @@ export enum OrderType {
|
||||
ToRoom = "room",
|
||||
ToOffice = "office",
|
||||
Booking = "booking",
|
||||
Pay = "pay"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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";
|
||||
@@ -9,11 +10,9 @@ import styles from "../address/address.module.css";
|
||||
import { AddressSummary } from "./components/AddressSummary";
|
||||
import BriefMenu from "./components/BriefMenu";
|
||||
import CheckoutButton from "./components/CheckoutButton";
|
||||
import { GiftDetails } from "./components/GiftDetails";
|
||||
import PhoneCard from "./components/phoneCard";
|
||||
import InputCard from "components/InputCard";
|
||||
import { OrderType } from "./hooks/types";
|
||||
import { GiftCard } from "./components/GiftCard";
|
||||
import PhoneCard from "./components/phoneCard";
|
||||
import { OrderType } from "./hooks/types";
|
||||
|
||||
export default function CheckoutPage() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
Reference in New Issue
Block a user