Compare commits
2 Commits
19212860c3
...
c84168cec5
| Author | SHA1 | Date | |
|---|---|---|---|
| c84168cec5 | |||
| 567930e27e |
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user