checkout: keep enhacning

This commit is contained in:
2025-12-24 23:02:26 +03:00
parent 567930e27e
commit c84168cec5
4 changed files with 54 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ import { useAppDispatch, useAppSelector } from "redux/hooks";
import ProText from "../ProText"; import ProText from "../ProText";
import ProTitle from "../ProTitle"; import ProTitle from "../ProTitle";
import styles from "./OrderSummary.module.css"; import styles from "./OrderSummary.module.css";
import { CSSProperties } from "react";
export default function OrderSummary() { export default function OrderSummary() {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -38,6 +39,15 @@ export default function OrderSummary() {
(restaurant?.customer_loyalty_points ?? 0) <= (restaurant?.customer_loyalty_points ?? 0) <=
0; 0;
const titlesStyle: CSSProperties = {
fontWeight: 400,
fontStyle: "Regular",
fontSize: 16,
lineHeight: "140%",
letterSpacing: "0%",
textAlign: "center",
};
return ( return (
<> <>
<Card className={`${styles.orderSummary}`}> <Card className={`${styles.orderSummary}`}>
@@ -45,37 +55,67 @@ export default function OrderSummary() {
<Divider style={{ margin: "15px 0 15px 0" }} /> <Divider style={{ margin: "15px 0 15px 0" }} />
<Space orientation="vertical" style={{ width: "100%" }}> <Space orientation="vertical" style={{ width: "100%" }}>
<div className={styles.summaryRow}> <div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.basketTotal")}</ProText> <ProText type="secondary" style={titlesStyle}>
<ArabicPrice price={subtotal} /> {t("cart.basketTotal")}
</ProText>
<ArabicPrice price={subtotal} style={titlesStyle} />
</div> </div>
{orderType === OrderType.Delivery && ( {orderType === OrderType.Delivery && (
<div className={styles.summaryRow}> <div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.deliveryFee")}</ProText> <ProText type="secondary" style={titlesStyle}>
<ArabicPrice price={Number(restaurant?.delivery_fees || 0)} /> {t("cart.deliveryFee")}
</ProText>
<ArabicPrice
price={Number(restaurant?.delivery_fees || 0)}
style={titlesStyle}
/>
</div> </div>
)} )}
<div className={styles.summaryRow}> <div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.discount")}</ProText> <ProText type="secondary" style={titlesStyle}>
<ArabicPrice price={discountAmount} /> {t("cart.discount")}
</ProText>
<ArabicPrice price={discountAmount} style={titlesStyle} />
</div> </div>
<div className={styles.summaryRow}> <div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.tax")}</ProText> <ProText type="secondary" style={titlesStyle}>
<ArabicPrice price={taxAmount || 0} /> {t("cart.tax")}
</ProText>
<ArabicPrice price={taxAmount || 0} style={titlesStyle} />
</div> </div>
{splitBillAmount > 0 && ( {splitBillAmount > 0 && (
<div className={styles.summaryRow}> <div className={styles.summaryRow}>
<ProText type="secondary"> <ProText type="secondary" style={titlesStyle}>
{t("splitBill.splitBillAmount")} {t("splitBill.splitBillAmount")}
</ProText> </ProText>
<ArabicPrice price={splitBillAmount} /> <ArabicPrice price={splitBillAmount} style={titlesStyle} />
</div> </div>
)} )}
<Divider className={styles.summaryDivider} /> <Divider className={styles.summaryDivider} />
<div className={`${styles.summaryRow} ${styles.totalRow}`}> <div className={`${styles.summaryRow} ${styles.totalRow}`}>
<ProText strong type="secondary"> <ProText
style={{
fontWeight: 600,
fontStyle: "SemiBold",
fontSize: 18,
lineHeight: "140%",
letterSpacing: "0%",
textAlign: "center",
}}
>
{t("cart.totalAmount")} {t("cart.totalAmount")}
</ProText> </ProText>
<ArabicPrice price={grandTotal} /> <ArabicPrice
price={grandTotal}
style={{
fontWeight: 600,
fontStyle: "SemiBold",
fontSize: 18,
lineHeight: "140%",
letterSpacing: "0%",
textAlign: "center",
}}
/>
</div> </div>
</Space> </Space>

View File

@@ -15,7 +15,7 @@ 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/Phone1Card"; import PhoneCard from "./components/PhoneCard";
import BriefMenuCard from "./components/BriefMenuCard"; import BriefMenuCard from "./components/BriefMenuCard";
export default function CheckoutPage() { export default function CheckoutPage() {

View File

@@ -7,7 +7,7 @@ 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/Phone1Card"; 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";