From 1c5c21257431712dfbb971813abdf899d1e3ccd5 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Fri, 2 Jan 2026 06:14:44 +0300 Subject: [PATCH] add split bill participants BS --- src/assets/locals/ar.json | 5 + src/assets/locals/en.json | 5 + .../SplitBillParticipantsBottomSheet.tsx | 146 ++++++++++++++++++ src/pages/order/order.module.css | 24 ++- src/pages/order/page.tsx | 137 +++++++++++++--- 5 files changed, 287 insertions(+), 30 deletions(-) create mode 100644 src/pages/order/components/SplitBillParticipantsBottomSheet.tsx diff --git a/src/assets/locals/ar.json b/src/assets/locals/ar.json index c7e74cd..d9b9f69 100644 --- a/src/assets/locals/ar.json +++ b/src/assets/locals/ar.json @@ -378,6 +378,10 @@ "confirmOTPSuccess": "تم التحقق من رمز التحقق بنجاح" }, "order": { + "whosPaidTheirShareSplitBill": "من قام بدفع نصيبه من الفاتورة؟", + "seeWhoPaidAndHowMuch": "اعرض من قام بدفع نصيبه من الفاتورة وكم يبلغ نصيبه", + "personHasPaid": "قام بدفع نصيبه من الفاتورة", + "inviteOthersToBill": "دع الآخرين يدفعوا معك", "title": "الطلب", "newOrder": "طلب جديد", "paymentSummary": "ملخص الدفع", @@ -438,6 +442,7 @@ "payButtonDescription": "الدفع للطلب" }, "splitBill": { + "serviceFee": "نصيب الخدمة", "title": "تقسيم الفاتورة", "description": "تقسيم الفاتورة", "splitBill": "تقسيم الفاتورة", diff --git a/src/assets/locals/en.json b/src/assets/locals/en.json index b80327e..81fb41e 100644 --- a/src/assets/locals/en.json +++ b/src/assets/locals/en.json @@ -391,6 +391,10 @@ "confirmOTPSuccess": "OTP confirmed successfully" }, "order": { + "whosPaidTheirShareSplitBill": "Who's paid their share of the split bill?", + "seeWhoPaidAndHowMuch": "See who paid and how much", + "personHasPaid": "Person has paid", + "inviteOthersToBill": "Invite others to bill", "title": "Order", "newOrder": "New Order", "aStaffMemberWillCollectTheCashFromYouAtYourTable": "A staff member will collect the cash from you at your table", @@ -450,6 +454,7 @@ "payButtonDescription": "Pay for your order" }, "splitBill": { + "serviceFee": "Service Fee", "title": "Split Bill", "description": "Split Bill", "splitBill": "Split Bill", diff --git a/src/pages/order/components/SplitBillParticipantsBottomSheet.tsx b/src/pages/order/components/SplitBillParticipantsBottomSheet.tsx new file mode 100644 index 0000000..4bdfb3b --- /dev/null +++ b/src/pages/order/components/SplitBillParticipantsBottomSheet.tsx @@ -0,0 +1,146 @@ +import { Button } from "antd"; +import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx"; +import { useTranslation } from "react-i18next"; + +import { useAppSelector } from "redux/hooks"; +import ProText from "components/ProText"; +import ArabicPrice from "components/ArabicPrice"; +import styles from "../order.module.css"; +import NextIcon from "components/Icons/NextIcon"; +import BackIcon from "components/Icons/BackIcon"; + +interface SplitBillParticipantsBottomSheetProps { + isOpen: boolean; + onClose: () => void; +} + +export function SplitBillParticipantsBottomSheet({ + isOpen, + onClose, +}: SplitBillParticipantsBottomSheetProps) { + const { t } = useTranslation(); + const { isRTL } = useAppSelector((state) => state.locale); + + const taxesChargesStyle = { + fontWeight: 400, + fontStyle: "Regular", + fontSize: 12, + lineHeight: "140%", + letterSpacing: "0%", + color: "#777580", + }; + + return ( + +
+
+ +
+ + {t("order.personHasPaid")} + +
+ {isRTL ? : } +
+
+ +
+
+ + {t("splitBill.totalBill")} + + +
+
+ + {t("splitBill.serviceFee")} + + +
+
+ + {t("splitBill.remainingToPay")} + + +
+ + {t("splitBill.includesAllOfTaxesCharges")} + +
+
+ ); +} diff --git a/src/pages/order/order.module.css b/src/pages/order/order.module.css index b30794c..0d3550d 100644 --- a/src/pages/order/order.module.css +++ b/src/pages/order/order.module.css @@ -314,17 +314,17 @@ } .orderContent { - display: flex; - flex-direction: column; - padding: 16px; - gap: 16px; - overflow: auto; - scrollbar-width: none; + display: flex; + flex-direction: column; + padding: 16px; + gap: 16px; + overflow: auto; + scrollbar-width: none; } /* CheckoutButton Styles */ -.checkoutButton{ +.checkoutButton { width: 100%; } @@ -348,3 +348,13 @@ :global(.darkApp) .checkoutButtonContainer { background-color: #000000 !important; } + +.inviteToBill { + gap: 16px; + opacity: 1; + border-radius: 6px; + display: flex; + flex-direction: row; + justify-content: flex-start; + place-items: center; +} diff --git a/src/pages/order/page.tsx b/src/pages/order/page.tsx index 92d5b09..8026ab7 100644 --- a/src/pages/order/page.tsx +++ b/src/pages/order/page.tsx @@ -37,6 +37,8 @@ import { QRBottomSheet } from "pages/pay/components/splitBill/QRBottomSheet"; import NewRateIcon from "components/Icons/order/NewRateIcon"; import NoteIcon from "components/Icons/NoteIcon"; import SuccessIcon from "components/Icons/SuccessIcon"; +import ProInputCard from "components/ProInputCard/ProInputCard"; +import { SplitBillParticipantsBottomSheet } from "./components/SplitBillParticipantsBottomSheet"; export default function OrderPage() { const { t } = useTranslation(); @@ -47,7 +49,7 @@ export default function OrderPage() { const hasRefetchedRef = useRef(false); const [isOpen, setIsOpen] = useState(false); const [isRateOrderOpen, setIsRateOrderOpen] = useState(false); - + const [isSplitBillParticipantsBottomSheetOpen, setIsSplitBillParticipantsBottomSheetOpen] = useState(false); const { data: orderDetails } = useGetOrderDetailsQuery( { orderID: orderId || "", @@ -322,9 +324,8 @@ export default function OrderPage() { ) : ( -
- - +
+
)} @@ -497,32 +498,121 @@ export default function OrderPage() { - {hasClosedStatus && ( - setIsOpen(true)} + {/* inviteToBill */} + {!hasClosedStatus && ( + +
+ + {t("order.whosPaidTheirShareSplitBill")} + + + {t("order.seeWhoPaidAndHowMuch")} + +
+ + } > -
setIsSplitBillParticipantsBottomSheetOpen(true)}> + +
+ + {t("order.personHasPaid")} + +
+ {isRTL ? ( + + ) : ( + + )} +
+
- + + {t("order.inviteOthersToBill")} + + + )} setIsOpen(false)} /> @@ -589,6 +679,7 @@ export default function OrderPage() { )} + setIsSplitBillParticipantsBottomSheetOpen(false)} /> ); }