cart & checkout: UI enhacnements

This commit is contained in:
2025-12-25 21:13:25 +03:00
parent 90e729cdce
commit ce9092d634
24 changed files with 167 additions and 86 deletions

View File

@@ -166,6 +166,7 @@
"customizable": "قابل للتخصيص" "customizable": "قابل للتخصيص"
}, },
"cart": { "cart": {
"leaveANoteHere": "أي تعليمات خاصة لطلبك..",
"title": "السلة", "title": "السلة",
"emptyCart": "سلة المشتريات فارغة", "emptyCart": "سلة المشتريات فارغة",
"emptyCartMessage": "يبدو أنك لم تضيف أي عناصر إلى سلة المشتريات بعد. ابدأ في استكشاف قائمتنا للعثور على وجبات لذيذة!", "emptyCartMessage": "يبدو أنك لم تضيف أي عناصر إلى سلة المشتريات بعد. ابدأ في استكشاف قائمتنا للعثور على وجبات لذيذة!",
@@ -263,6 +264,8 @@
"checkRequiredFields": "يرجى التحقق من الحقول المطلوبة" "checkRequiredFields": "يرجى التحقق من الحقول المطلوبة"
}, },
"checkout": { "checkout": {
"customerName": "اسم العميل",
"customerInformation": "تفاصيل العميل",
"title": "الدفع", "title": "الدفع",
"cash": "كاش", "cash": "كاش",
"creditDebitCard": "بطاقة ائتمان/ائتمان", "creditDebitCard": "بطاقة ائتمان/ائتمان",

View File

@@ -178,6 +178,7 @@
"customizable": "Customizable" "customizable": "Customizable"
}, },
"cart": { "cart": {
"leaveANoteHere": "Leave a note here..",
"title": "Cart", "title": "Cart",
"emptyCart": "Cart is empty", "emptyCart": "Cart is empty",
"emptyCartMessage": "Looks like you haven't added any items to your cart yet. Start exploring our menu to find delicious meals!", "emptyCartMessage": "Looks like you haven't added any items to your cart yet. Start exploring our menu to find delicious meals!",
@@ -273,6 +274,8 @@
"checkRequiredFields": "Please check required fields" "checkRequiredFields": "Please check required fields"
}, },
"checkout": { "checkout": {
"customerName": "Customer Name",
"customerInformation": "Customer Information",
"title": "Checkout", "title": "Checkout",
"cash": "Cash", "cash": "Cash",
"creditDebitCard": "Credit/Debit Card", "creditDebitCard": "Credit/Debit Card",

View File

@@ -104,7 +104,7 @@ export default function CartActionsButtons({ item }: { item: CartItem }) {
)} )}
<InputNumber <InputNumber
min={1} min={1}
max={100} max={99}
value={item.quantity || 1} value={item.quantity || 1}
onChange={(value: number | null) => onChange={(value: number | null) =>
dispatch( dispatch(

View File

@@ -42,7 +42,7 @@ export function TipBottomSheet({
showCloseButton={false} showCloseButton={false}
initialSnap={1} initialSnap={1}
height={370} height={370}
snapPoints={["30vh"]} snapPoints={[370]}
> >
<div <div
style={{ style={{
@@ -52,7 +52,9 @@ export function TipBottomSheet({
justifyContent: "center", justifyContent: "center",
}} }}
> >
<div style={{ marginTop: 20 }}>
<WaiterRewardingIcon /> <WaiterRewardingIcon />
</div>
<br /> <br />

View File

@@ -1,22 +1,26 @@
interface DeleteIconType { interface DeleteIconType {
className?: string; className?: string;
onClick?: () => void; onClick?: () => void;
color?: string;
dimension?: number;
} }
const DeleteIcon = ({ className, onClick }: DeleteIconType) => { const DeleteIcon = ({ className, onClick, color, dimension }: DeleteIconType) => {
return ( return (
<svg <svg
width="12" width={dimension || "14"}
height="12" height={dimension || "14"}
viewBox="0 0 12 12" viewBox="0 0 14 14"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
className={className} className={className}
onClick={onClick} onClick={onClick}
> >
<path <path
d="M3 2.4V0.6C3 0.44087 3.06321 0.288258 3.17574 0.175736C3.28826 0.0632141 3.44087 0 3.6 0H8.4C8.55913 0 8.71174 0.0632141 8.82426 0.175736C8.93679 0.288258 9 0.44087 9 0.6V2.4H12V3.6H10.8V11.4C10.8 11.5591 10.7368 11.7117 10.6243 11.8243C10.5117 11.9368 10.3591 12 10.2 12H1.8C1.64087 12 1.48826 11.9368 1.37574 11.8243C1.26321 11.7117 1.2 11.5591 1.2 11.4V3.6H0V2.4H3ZM6.8484 7.2L7.9092 6.1392L7.0608 5.2908L6 6.3516L4.9392 5.2908L4.0908 6.1392L5.1516 7.2L4.0908 8.2608L4.9392 9.1092L6 8.0484L7.0608 9.1092L7.9092 8.2608L6.8484 7.2ZM4.2 1.2V2.4H7.8V1.2H4.2Z" d="M11.375 3.20866L11.0133 9.05658C10.9212 10.5505 10.8751 11.2977 10.5 11.835C10.3148 12.1005 10.0764 12.3246 9.8 12.493C9.24175 12.8337 8.49333 12.8337 6.9965 12.8337C5.49733 12.8337 4.74775 12.8337 4.18833 12.4924C3.91177 12.3237 3.67337 12.0992 3.48833 11.8332C3.11383 11.2954 3.06833 10.547 2.9785 9.05074L2.625 3.20866M1.75 3.20866H12.25M9.366 3.20866L8.96758 2.38733C8.70333 1.84133 8.57092 1.56891 8.34283 1.39858C8.29217 1.36084 8.23852 1.32729 8.18242 1.29824C7.92983 1.16699 7.6265 1.16699 7.02042 1.16699C6.39858 1.16699 6.08767 1.16699 5.83042 1.30349C5.77355 1.33395 5.71931 1.36907 5.66825 1.40849C5.43783 1.58524 5.30892 1.86816 5.05108 2.43341L4.69758 3.20866M5.54167 9.62533V6.12533M8.45833 9.62533V6.12533"
fill="#DC2626" stroke={color || "#DD4143"}
strokeWidth="1.5"
strokeLinecap="round"
/> />
</svg> </svg>
); );

View File

@@ -1,13 +1,14 @@
interface PlusIconType { interface PlusIconType {
className?: string; className?: string;
onClick?: () => void; onClick?: () => void;
dimesion?: string
} }
const PlusIcon = ({ className, onClick }: PlusIconType) => { const PlusIcon = ({ className, onClick, dimesion }: PlusIconType) => {
return ( return (
<svg <svg
width="16" width={dimesion || "16"}
height="16" height={dimesion || "16"}
viewBox="0 0 16 16" viewBox="0 0 16 16"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View File

@@ -32,7 +32,7 @@ export default function InputCard({
placeholder={placeholder} placeholder={placeholder}
size="large" size="large"
autoFocus={false} autoFocus={false}
style={{ padding: "7px 11px", height: 50, borderRadius: 888 }} style={{ padding: "7px 11px", height: 48, borderRadius: 888 }}
value={value} value={value}
onChange={handleChange} onChange={handleChange}
/> />

View File

@@ -88,7 +88,7 @@ const PaymentMethods = () => {
}} }}
size="large" size="large"
> >
<Space orientation="vertical" style={{ width: "100%" }}> <Space orientation="vertical" style={{ width: "100%", gap: 16 }}>
{options.map((option) => ( {options.map((option) => (
<div key={option.value}> <div key={option.value}>
<Radio <Radio
@@ -96,7 +96,7 @@ const PaymentMethods = () => {
value={option.value} value={option.value}
onClick={() => onPaymentSelect(option.value)} onClick={() => onPaymentSelect(option.value)}
style={{ style={{
height: 50, height: 48,
borderRadius: 888, borderRadius: 888,
border: "1px solid #DDD", border: "1px solid #DDD",
padding: 16, padding: 16,

View File

@@ -86,7 +86,7 @@ export const PhoneInputWrapper = ({
const inputStyle = useMemo( const inputStyle = useMemo(
() => ({ () => ({
borderRadius: 1000, borderRadius: 1000,
height: 50, height: 48,
width: "100%", width: "100%",
color: themeName === "light" ? "#000" : "#FFF", color: themeName === "light" ? "#000" : "#FFF",
backgroundColor: themeName === "light" ? "#FFF" : ProBlack1, backgroundColor: themeName === "light" ? "#FFF" : ProBlack1,

View File

@@ -37,9 +37,15 @@ const ProRatioGroups = ({
onChange={handleChange} onChange={handleChange}
{...props} {...props}
> >
<Space direction="vertical" style={{ width: "100%" }}> <Space orientation="vertical" style={{ width: "100%" }}>
{options.map((option) => ( {options.map((option) => (
<Radio key={option.value} value={option.value}> <Radio
key={option.value}
value={option.value}
// style={{
// height: 48,
// }}
>
<div <div
style={{ style={{
display: "flex", display: "flex",

View File

@@ -70,6 +70,7 @@ interface CartState {
pickupType: string; pickupType: string;
order: any; order: any;
splitBillAmount: number; splitBillAmount: number;
customerName: string;
} }
// localStorage keys // localStorage keys
@@ -187,6 +188,7 @@ const initialState: CartState = {
pickupType: getFromLocalStorage(CART_STORAGE_KEYS.PICKUP_TYPE, ""), pickupType: getFromLocalStorage(CART_STORAGE_KEYS.PICKUP_TYPE, ""),
order: getFromLocalStorage(CART_STORAGE_KEYS.ORDER, null), order: getFromLocalStorage(CART_STORAGE_KEYS.ORDER, null),
splitBillAmount: 0, splitBillAmount: 0,
customerName: "",
}; };
const orderSlice = createSlice({ const orderSlice = createSlice({
@@ -637,6 +639,9 @@ const orderSlice = createSlice({
updateSplitBillAmount(state, action: PayloadAction<number>) { updateSplitBillAmount(state, action: PayloadAction<number>) {
state.splitBillAmount = action.payload; state.splitBillAmount = action.payload;
}, },
updateCustomerName(state, action: PayloadAction<string>) {
state.customerName = action.payload;
},
}, },
}); });
@@ -675,6 +680,7 @@ export const {
updatePickUpType, updatePickUpType,
updateOrder, updateOrder,
updateSplitBillAmount, updateSplitBillAmount,
updateCustomerName,
} = orderSlice.actions; } = orderSlice.actions;
// Tax calculation helper functions // Tax calculation helper functions

View File

@@ -605,3 +605,8 @@
outline: 2px solid #ffffff; outline: 2px solid #ffffff;
outline-offset: 2px; outline-offset: 2px;
} }
.deleteIcon {
position: relative;
top: 1px;
}

View File

@@ -24,7 +24,7 @@ export default function CarPlateCard() {
placeholder={t("cart.plateNumber")} placeholder={t("cart.plateNumber")}
size="large" size="large"
autoFocus={false} autoFocus={false}
style={{ padding: "7px 11px", height: 50, borderRadius: 888 }} style={{ padding: "7px 11px", height: 48, borderRadius: 888 }}
value={plateCar} value={plateCar}
onChange={(e) => { onChange={(e) => {
dispatch(updatePlateCar(e.target.value)); dispatch(updatePlateCar(e.target.value));

View File

@@ -1,5 +1,4 @@
import { PlusOutlined } from "@ant-design/icons"; import { Card, Divider, Space, Layout, Button } from "antd";
import { Card, Divider, Space, Layout } from "antd";
import ArabicPrice from "components/ArabicPrice"; import ArabicPrice from "components/ArabicPrice";
import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx"; import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx";
import ImageWithFallback from "components/ImageWithFallback"; import ImageWithFallback from "components/ImageWithFallback";
@@ -9,8 +8,7 @@ import ProTitle from "components/ProTitle.tsx";
import { selectCart } from "features/order/orderSlice.ts"; import { selectCart } from "features/order/orderSlice.ts";
import styles from "pages/cart/cart.module.css"; import styles from "pages/cart/cart.module.css";
import YouMightAlsoLike from "pages/cart/components/youMayLike/YouMightAlsoLike.tsx"; import YouMightAlsoLike from "pages/cart/components/youMayLike/YouMightAlsoLike.tsx";
import { Link, useParams } from "react-router-dom"; import { Link, useNavigate, useParams } from "react-router-dom";
import { colors } from "ThemeConstants.ts";
import { useAppSelector } from "redux/hooks.ts"; import { useAppSelector } from "redux/hooks.ts";
@@ -18,13 +16,14 @@ import { FormInstance } from "antd";
import useBreakPoint from "hooks/useBreakPoint.ts"; import useBreakPoint from "hooks/useBreakPoint.ts";
import CarPlateCard from "pages/cart/components/CarPlateCard.tsx"; import CarPlateCard from "pages/cart/components/CarPlateCard.tsx";
import CartFooter from "pages/cart/components/cartFooter/CartFooter.tsx"; import CartFooter from "pages/cart/components/cartFooter/CartFooter.tsx";
import CouponCard from "pages/cart/components/CouponCard.tsx";
import SpecialRequestCard from "pages/cart/components/specialRequest/SpecialRequestCard.tsx"; import SpecialRequestCard from "pages/cart/components/specialRequest/SpecialRequestCard.tsx";
import TableNumberCard from "pages/cart/components/TableNumberCard.tsx"; import TableNumberCard from "pages/cart/components/TableNumberCard.tsx";
import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCard.tsx"; import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCard.tsx";
import { OrderType } from "pages/checkout/hooks/types"; import { OrderType } from "pages/checkout/hooks/types";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Variant } from "utils/types/appTypes"; import { Variant } from "utils/types/appTypes";
import DeleteIcon from "components/Icons/DeleteIcon";
import PlusIcon from "components/Icons/PlusIcon";
interface CartMobileTabletLayoutProps { interface CartMobileTabletLayoutProps {
form: FormInstance; form: FormInstance;
@@ -39,8 +38,8 @@ export default function CartMobileTabletLayout({
const { subdomain } = useParams(); const { subdomain } = useParams();
const { pickup_type } = useAppSelector((state) => state.order.restaurant); const { pickup_type } = useAppSelector((state) => state.order.restaurant);
const { isMobile, isTablet } = useBreakPoint(); const { isMobile, isTablet } = useBreakPoint();
const getResponsiveClass = () => (isTablet ? "tablet" : "mobile"); const getResponsiveClass = () => (isTablet ? "tablet" : "mobile");
const navigate = useNavigate();
const getMenuItemImageStyle = () => { const getMenuItemImageStyle = () => {
if (isMobile) { if (isMobile) {
@@ -82,11 +81,21 @@ export default function CartMobileTabletLayout({
> >
<div <div
style={{ style={{
marginTop: 10, marginTop: 3,
boxSizing: "border-box", // Explicit box model definition boxSizing: "border-box", // Explicit box model definition
}} }}
> >
<ProTitle level={5} style={{ whiteSpace: "nowrap" }}> <ProTitle
level={5}
style={{
whiteSpace: "nowrap",
fontWeight: 500,
fontStyle: "Medium",
fontSize: 18,
lineHeight: "140%",
letterSpacing: 0,
}}
>
{t("cart.yourOrder")} {t("cart.yourOrder")}
</ProTitle> </ProTitle>
</div> </div>
@@ -100,25 +109,29 @@ export default function CartMobileTabletLayout({
textAlign: "end", textAlign: "end",
}} }}
> >
<div <Button
shape="circle"
iconPlacement="start"
icon={
<DeleteIcon
className={styles.deleteIcon}
color={"#C0BFC4"}
dimension={16}
/>
}
size="small"
className={styles.addButton}
style={{ style={{
color: colors.primary, width: 32,
}} height: 32,
> border: "1px solid #DEDEE0",
<PlusOutlined
style={{
color: colors.primary,
marginLeft: 5,
marginTop: 15,
}} }}
/> />
{t("cart.addMore")}
</div>
</Link> </Link>
</div> </div>
{items.length >= 1 && ( {items.length >= 1 && (
<Divider style={{ margin: "0px 0px 10px 0px" }} /> <Divider style={{ margin: "8px 0px 12px 0px" }} />
)} )}
{items.map((item, index) => ( {items.map((item, index) => (
<div key={index} style={{ position: "relative" }}> <div key={index} style={{ position: "relative" }}>
@@ -230,6 +243,16 @@ export default function CartMobileTabletLayout({
)} )}
</div> </div>
))} ))}
<Button
style={{ width: "100%", marginTop: 24, color: "#4C4A58" }}
onClick={() => {
navigate(`/${subdomain}/menu?${
orderType ? `orderType=${orderType}` : ""
}`);
}}
>
<PlusIcon dimesion="18" /> {t("cart.addMore")}
</Button>
</Card> </Card>
</div> </div>
</div> </div>

View File

@@ -83,7 +83,7 @@ export default function CouponCard() {
placeholder={t("cart.couponCode")} placeholder={t("cart.couponCode")}
size="large" size="large"
autoFocus={false} autoFocus={false}
style={{ padding: "7px 11px", height: 50 }} style={{ padding: "7px 11px", height: 48 }}
onChange={(e) => { onChange={(e) => {
dispatch(updateCoupon(e.target.value)); dispatch(updateCoupon(e.target.value));
}} }}

View File

@@ -1,5 +1,12 @@
.inputField { .inputField {
height: 50px; border-radius: 8px !important;
justify-content: space-between;
padding-top: 12px;
padding-right: 16px;
padding-bottom: 12px;
padding-left: 16px;
opacity: 1;
border-width: 1px;
} }
.editButton { .editButton {

View File

@@ -9,13 +9,13 @@ import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useAppDispatch, useAppSelector } from "redux/hooks.ts"; import { useAppDispatch, useAppSelector } from "redux/hooks.ts";
import styles from "./SpecialRequestCard.module.css"; import styles from "./SpecialRequestCard.module.css";
import TextArea from "antd/es/input/TextArea";
export default function SpecialRequestCard() { export default function SpecialRequestCard() {
const { t } = useTranslation(); const { t } = useTranslation();
const { isDesktop } = useBreakPoint(); const { isDesktop } = useBreakPoint();
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { specialRequest } = useAppSelector(selectCart); const { specialRequest } = useAppSelector(selectCart);
const { isRTL } = useAppSelector((state) => state.locale);
const [isSpecialRequestOpen, setIsSpecialRequestOpen] = useState(false); const [isSpecialRequestOpen, setIsSpecialRequestOpen] = useState(false);
const handleSpecialRequestSave = (value: string) => { const handleSpecialRequestSave = (value: string) => {
@@ -32,12 +32,8 @@ export default function SpecialRequestCard() {
title={t("cart.specialRequest")} title={t("cart.specialRequest")}
dividerStyle={{ margin: "5px 0 0 0" }} dividerStyle={{ margin: "5px 0 0 0" }}
> >
<Form.Item <Form.Item name="specialRequest" style={{ marginTop: 12 }}>
label={t("cart.specialRequest")} {/* <Input
name="specialRequest"
style={{ position: "relative", top: -5 }}
>
<Input
placeholder={t("cart.specialRequest")} placeholder={t("cart.specialRequest")}
size="large" size="large"
autoFocus={false} autoFocus={false}
@@ -51,6 +47,13 @@ export default function SpecialRequestCard() {
<u>{t("cart.editNote")}</u> {isRTL ? <LeftOutlined /> : <RightOutlined />} <u>{t("cart.editNote")}</u> {isRTL ? <LeftOutlined /> : <RightOutlined />}
</div> </div>
} }
/> */}
<TextArea
placeholder={t("cart.leaveANoteHere")}
rows={2}
autoFocus={false}
className={styles.inputField}
onChange={(e) => handleSpecialRequestSave(e.target.value)}
/> />
</Form.Item> </Form.Item>
</ProInputCard> </ProInputCard>

View File

@@ -22,8 +22,8 @@ export function BottomSheet({
title={t("cart.selectTimeEstimate")} title={t("cart.selectTimeEstimate")}
showCloseButton={true} showCloseButton={true}
initialSnap={1} initialSnap={1}
height={555} height={495}
snapPoints={["65vh"]} snapPoints={[495]}
> >
<Content onSave={onSave} onClose={onClose} /> <Content onSave={onSave} onClose={onClose} />
</ProBottomSheet> </ProBottomSheet>

View File

@@ -0,0 +1,3 @@
.customerInformationCard {
height: 215px !important;
}

View File

@@ -0,0 +1,44 @@
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
import ProPhoneInput from "components/ProPhoneInput";
import { selectCart, updateCustomerName } from "features/order/orderSlice";
import { OrderType } from "pages/checkout/hooks/types.ts";
import { useTranslation } from "react-i18next";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import { Form, Input } from "antd";
import styles from "./CustomerInformationCard.module.css";
export default function CustomerInformationCard() {
const { t } = useTranslation();
const { orderType } = useAppSelector(selectCart);
const dispatch = useAppDispatch();
const customerName = useAppSelector((state) => state.order.customerName);
return (
orderType !== OrderType.Gift && (
<>
<ProInputCard
title={t("checkout.customerInformation")}
className={styles.customerInformationCard}
>
<div style={{ position: "relative", top: -25 }}>
<Form.Item label={t("checkout.customerName")} name="customerName">
<Input
placeholder={t("checkout.customerName")}
size="large"
autoFocus={false}
style={{ padding: "7px 11px", height: 48, borderRadius: 888 }}
value={customerName}
onChange={(e) => {
dispatch(updateCustomerName(e.target.value));
}}
/>
</Form.Item>
</div>
<div style={{ position: "relative", top: -30 }}>
<ProPhoneInput label={t("login.phone")} propName="phone" />
</div>
</ProInputCard>
</>
)
);
}

View File

@@ -1,3 +0,0 @@
.phoneCard {
height: 150px !important;
}

View File

@@ -1,27 +0,0 @@
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
import ProPhoneInput from "components/ProPhoneInput";
import { selectCart } from "features/order/orderSlice";
import { OrderType } from "pages/checkout/hooks/types.ts";
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";
import styles from "./PhoneCard.module.css";
export default function PhoneCard() {
const { t } = useTranslation();
const { orderType } = useAppSelector(selectCart);
return (
orderType !== OrderType.Gift && (
<>
<ProInputCard
title={t("checkout.phoneNumber")}
className={styles.phoneCard}
>
<div style={{ position: "relative", top: -20 }}>
<ProPhoneInput label={t("login.phone")} propName="phone" />
</div>
</ProInputCard>
</>
)
);
}

View File

@@ -15,8 +15,8 @@ import RewardWaiterCard from "pages/cart/components/RewardWaiterCard";
import ProInputCard from "components/ProInputCard/ProInputCard"; import ProInputCard from "components/ProInputCard/ProInputCard";
import ProRatioGroups from "components/ProRatioGroups/ProRatioGroups"; import ProRatioGroups from "components/ProRatioGroups/ProRatioGroups";
import CouponCard from "pages/cart/components/CouponCard"; import CouponCard from "pages/cart/components/CouponCard";
import PhoneCard from "./components/PhoneCard";
import BriefMenuCard from "./components/BriefMenuCard"; import BriefMenuCard from "./components/BriefMenuCard";
import CustomerInformationCard from "./components/CustomerInformationCard";
export default function CheckoutPage() { export default function CheckoutPage() {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -37,7 +37,7 @@ export default function CheckoutPage() {
<ProHeader>{t("checkout.title")}</ProHeader> <ProHeader>{t("checkout.title")}</ProHeader>
<Layout.Content className={styles.checkoutContainer}> <Layout.Content className={styles.checkoutContainer}>
<PaymentMethods /> <PaymentMethods />
{!token && <PhoneCard />} {!token && <CustomerInformationCard />}
<AddressSummary /> <AddressSummary />
{orderType === OrderType.ToRoom && ( {orderType === OrderType.ToRoom && (
<InputCard <InputCard

View File

@@ -7,18 +7,19 @@ import { selectCart } from "features/order/orderSlice";
import { AddressSummary } from "pages/checkout/components/AddressSummary"; import { AddressSummary } from "pages/checkout/components/AddressSummary";
import BriefMenu from "pages/checkout/components/BriefMenu"; import BriefMenu from "pages/checkout/components/BriefMenu";
import { GiftCard } from "pages/checkout/components/GiftCard"; import { GiftCard } from "pages/checkout/components/GiftCard";
import PhoneCard from "pages/checkout/components/PhoneCard";
import { OrderType } from "pages/checkout/hooks/types"; import { OrderType } from "pages/checkout/hooks/types";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks"; import { useAppSelector } from "redux/hooks";
import styles from "../address/address.module.css"; import styles from "../address/address.module.css";
import PayButton from "./components/PayButton"; import PayButton from "./components/PayButton";
import CustomerInformationCard from "pages/checkout/components/CustomerInformationCard";
export default function PayPage() { export default function PayPage() {
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const { phone, order, orderType } = useAppSelector(selectCart); const { phone, order, orderType } = useAppSelector(selectCart);
const { token } = useAppSelector((state) => state.auth);
return ( return (
<> <>
<Form <Form
@@ -54,7 +55,7 @@ export default function PayPage() {
{/* <GiftDetails /> */} {/* <GiftDetails /> */}
<BriefMenu /> <BriefMenu />
<OrderSummary /> <OrderSummary />
<PhoneCard /> {!token && <CustomerInformationCard />}
<PaymentMethods /> <PaymentMethods />
</Layout.Content> </Layout.Content>