Compare commits
2 Commits
7b6fe140ad
...
2c676eb153
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c676eb153 | |||
| 6f1f4441f1 |
@@ -277,7 +277,10 @@
|
||||
"am": "ص",
|
||||
"pm": "م",
|
||||
"cannotSelectPastDate": "لا يمكنك اختيار تاريخ سابق. يرجى اختيار اليوم أو تاريخ مستقبلي.",
|
||||
"checkRequiredFields": "يرجى التحقق من الحقول المطلوبة"
|
||||
"checkRequiredFields": "يرجى التحقق من الحقول المطلوبة",
|
||||
"loyalty": "ولاء",
|
||||
"vatTax": "ضريبة (القيمة المضافة)",
|
||||
"otherTaxes": "ضريبة (أخرى)"
|
||||
},
|
||||
"checkout": {
|
||||
"addCarDetails": "إضافة تفاصيل السيارة",
|
||||
|
||||
@@ -295,7 +295,9 @@
|
||||
"cannotSelectPastDate": "You cannot select a past date. Please select today or a future date.",
|
||||
"checkRequiredFields": "Please check required fields",
|
||||
"applyYourAvailableRewardsToGetDiscountsOnItemsInYourCart": "Apply your available rewards to get discounts on items in your cart",
|
||||
"loyalty": "Loyalty"
|
||||
"loyalty": "Loyalty",
|
||||
"vatTax": "Tax (Vat)",
|
||||
"otherTaxes": "Tax (Other)"
|
||||
},
|
||||
"checkout": {
|
||||
"addCarDetails": "Add Car Details",
|
||||
|
||||
@@ -6,15 +6,13 @@ import {
|
||||
selectDiscountTotal,
|
||||
selectGrandTotal,
|
||||
selectHighestPricedLoyaltyItem,
|
||||
selectLoyaltyValidation,
|
||||
selectTaxAmount,
|
||||
updateUseLoyaltyPoints,
|
||||
} from "features/order/orderSlice";
|
||||
import { OrderType } from "pages/checkout/hooks/types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useGetRestaurantDetailsQuery } from "redux/api/others";
|
||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import ProText from "../ProText";
|
||||
import ProTitle from "../ProTitle";
|
||||
import styles from "./OrderSummary.module.css";
|
||||
@@ -25,7 +23,7 @@ export default function OrderSummary() {
|
||||
const { useLoyaltyPoints, splitBillAmount } = useAppSelector(selectCart);
|
||||
const { subdomain } = useParams();
|
||||
const { data: restaurant } = useGetRestaurantDetailsQuery(subdomain);
|
||||
const { orderType, tip } = useAppSelector(selectCart);
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
const subtotal = useAppSelector(selectCartTotal);
|
||||
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
|
||||
const taxAmount = useAppSelector(selectTaxAmount);
|
||||
@@ -46,6 +44,8 @@ export default function OrderSummary() {
|
||||
textAlign: "center",
|
||||
};
|
||||
|
||||
const vat = (restaurant?.vat ?? 0) / 100 * subtotal || 0
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card className={`${styles.orderSummary}`}>
|
||||
@@ -159,10 +159,21 @@ export default function OrderSummary() {
|
||||
{orderType !== OrderType.Redeem && (
|
||||
<div className={styles.summaryRow}>
|
||||
<ProText type="secondary" style={titlesStyle}>
|
||||
{t("cart.tax")}
|
||||
{t("cart.vatTax")}
|
||||
</ProText>
|
||||
<ArabicPrice
|
||||
price={taxAmount || 0}
|
||||
price={vat}
|
||||
textStyle={{ ...titlesStyle, color: "#434E5C" }}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{orderType !== OrderType.Redeem && (
|
||||
<div className={styles.summaryRow}>
|
||||
<ProText type="secondary" style={titlesStyle}>
|
||||
{t("cart.otherTaxes")}
|
||||
</ProText>
|
||||
<ArabicPrice
|
||||
price={taxAmount - vat || 0}
|
||||
textStyle={{ ...titlesStyle, color: "#434E5C" }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -4,13 +4,13 @@ import styles from "./OrderDetails.module.css";
|
||||
import ProHeader from "components/ProHeader/ProHeader";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import ProductChoicesCard from "components/productChoicesCard/ProductChoicesCard.tsx";
|
||||
|
||||
export default function OrderDetails() {
|
||||
const { orderId } = useParams();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { data: orderDetails } = useGetOrderDetailsQuery(
|
||||
{
|
||||
orderID: orderId || "",
|
||||
@@ -42,7 +42,7 @@ export default function OrderDetails() {
|
||||
type="primary"
|
||||
shape="round"
|
||||
className={styles.button}
|
||||
onClick={() => {}}
|
||||
onClick={() => navigate(-1)}
|
||||
>
|
||||
{t("order.done")}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user