Compare commits
11 Commits
a6abb089d2
...
1c5c212574
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c5c212574 | |||
| b33bae562d | |||
| f1ae1568a8 | |||
| d337eb4220 | |||
| 78f1227a3d | |||
| e5b86d09a3 | |||
| ab0a4219a2 | |||
| 527f4686de | |||
| 5e209d5d78 | |||
| 7d2925eeae | |||
| 6933e1ba3a |
@@ -37,6 +37,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
||||||
"@typescript-eslint/parser": "^7.13.1",
|
"@typescript-eslint/parser": "^7.13.1",
|
||||||
"@vitejs/plugin-react": "^4.3.1",
|
"@vitejs/plugin-react": "^4.3.1",
|
||||||
|
"baseline-browser-mapping": "^2.9.11",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-react-hooks": "^4.6.2",
|
"eslint-plugin-react-hooks": "^4.6.2",
|
||||||
"eslint-plugin-react-refresh": "^0.4.7",
|
"eslint-plugin-react-refresh": "^0.4.7",
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ export const themeConfig: ThemeConfig = {
|
|||||||
boxShadow: "0 1px 3px rgba(0,0,0,0.1)",
|
boxShadow: "0 1px 3px rgba(0,0,0,0.1)",
|
||||||
padding: 16,
|
padding: 16,
|
||||||
paddingLG: 16,
|
paddingLG: 16,
|
||||||
borderRadius: 24,
|
borderRadius: 16,
|
||||||
borderRadiusLG: 24,
|
borderRadiusLG: 16,
|
||||||
},
|
},
|
||||||
Carousel: {
|
Carousel: {
|
||||||
colorBgContainer: lightColors["800"],
|
colorBgContainer: lightColors["800"],
|
||||||
|
|||||||
@@ -167,6 +167,9 @@
|
|||||||
"customizable": "قابل للتخصيص"
|
"customizable": "قابل للتخصيص"
|
||||||
},
|
},
|
||||||
"cart": {
|
"cart": {
|
||||||
|
"addSpecialRequestOptional": "إضافة طلب خاص (اختياري)",
|
||||||
|
"continueToGiftDetails": "متابعة إلى تفاصيل الهدية",
|
||||||
|
"continueToGiftDetailsDescription": "يرجى إدخال تفاصيل المستلم والمرسل لمتابعة.",
|
||||||
"leaveANoteHere": "أي تعليمات خاصة لطلبك..",
|
"leaveANoteHere": "أي تعليمات خاصة لطلبك..",
|
||||||
"title": "السلة",
|
"title": "السلة",
|
||||||
"emptyCart": "سلة المشتريات فارغة",
|
"emptyCart": "سلة المشتريات فارغة",
|
||||||
@@ -293,7 +296,8 @@
|
|||||||
"pleaseEnterPhoneNumber": "يرجى إدخال رقم الهاتف",
|
"pleaseEnterPhoneNumber": "يرجى إدخال رقم الهاتف",
|
||||||
"viewOrder": "عرض الطلب",
|
"viewOrder": "عرض الطلب",
|
||||||
"itemsSummary": "ملخص العناصر",
|
"itemsSummary": "ملخص العناصر",
|
||||||
"removeSplitBill": "إزالة التقسيم"
|
"removeSplitBill": "إزالة التقسيم",
|
||||||
|
"cardBalance": "رصيد البطاقة"
|
||||||
},
|
},
|
||||||
"address": {
|
"address": {
|
||||||
"title": "العنوان",
|
"title": "العنوان",
|
||||||
@@ -374,6 +378,10 @@
|
|||||||
"confirmOTPSuccess": "تم التحقق من رمز التحقق بنجاح"
|
"confirmOTPSuccess": "تم التحقق من رمز التحقق بنجاح"
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
|
"whosPaidTheirShareSplitBill": "من قام بدفع نصيبه من الفاتورة؟",
|
||||||
|
"seeWhoPaidAndHowMuch": "اعرض من قام بدفع نصيبه من الفاتورة وكم يبلغ نصيبه",
|
||||||
|
"personHasPaid": "قام بدفع نصيبه من الفاتورة",
|
||||||
|
"inviteOthersToBill": "دع الآخرين يدفعوا معك",
|
||||||
"title": "الطلب",
|
"title": "الطلب",
|
||||||
"newOrder": "طلب جديد",
|
"newOrder": "طلب جديد",
|
||||||
"paymentSummary": "ملخص الدفع",
|
"paymentSummary": "ملخص الدفع",
|
||||||
@@ -434,6 +442,7 @@
|
|||||||
"payButtonDescription": "الدفع للطلب"
|
"payButtonDescription": "الدفع للطلب"
|
||||||
},
|
},
|
||||||
"splitBill": {
|
"splitBill": {
|
||||||
|
"serviceFee": "نصيب الخدمة",
|
||||||
"title": "تقسيم الفاتورة",
|
"title": "تقسيم الفاتورة",
|
||||||
"description": "تقسيم الفاتورة",
|
"description": "تقسيم الفاتورة",
|
||||||
"splitBill": "تقسيم الفاتورة",
|
"splitBill": "تقسيم الفاتورة",
|
||||||
@@ -491,6 +500,10 @@
|
|||||||
"eCardAmount": "مبلغ البطاقة الإلكترونية",
|
"eCardAmount": "مبلغ البطاقة الإلكترونية",
|
||||||
"receiverName": "اسم المستلم",
|
"receiverName": "اسم المستلم",
|
||||||
"edit": "تعديل",
|
"edit": "تعديل",
|
||||||
"yourInformation": "تفاصيلك"
|
"yourInformation": "تفاصيلك",
|
||||||
|
"minimumAmountShouldBe1OMR": "يجب أن يكون المبلغ الأدنى 1 OMR",
|
||||||
|
"add": "أضف",
|
||||||
|
"senderNameRequired": "يجب أن يكون اسم المرسل مطلوب",
|
||||||
|
"receiverNameRequired": "يجب أن يكون اسم المستلم مطلوب"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,9 @@
|
|||||||
"customizable": "Customizable"
|
"customizable": "Customizable"
|
||||||
},
|
},
|
||||||
"cart": {
|
"cart": {
|
||||||
|
"addSpecialRequestOptional": "Add Special Request (Optional)",
|
||||||
|
"continueToGiftDetails": "Continue to Gift Details",
|
||||||
|
"continueToGiftDetailsDescription": "Please fill in the details of the gift recipient and sender to continue.",
|
||||||
"leaveANoteHere": "Leave a note here..",
|
"leaveANoteHere": "Leave a note here..",
|
||||||
"changeTable": "Change Table",
|
"changeTable": "Change Table",
|
||||||
"title": "Cart",
|
"title": "Cart",
|
||||||
@@ -305,7 +308,8 @@
|
|||||||
"pleaseEnterPhoneNumber": "Please enter phone number",
|
"pleaseEnterPhoneNumber": "Please enter phone number",
|
||||||
"viewOrder": "View Order",
|
"viewOrder": "View Order",
|
||||||
"itemsSummary": "Items Summary",
|
"itemsSummary": "Items Summary",
|
||||||
"removeSplitBill": "Remove Split Bill"
|
"removeSplitBill": "Remove Split Bill",
|
||||||
|
"cardBalance": "Card Balance"
|
||||||
},
|
},
|
||||||
"address": {
|
"address": {
|
||||||
"title": "Address",
|
"title": "Address",
|
||||||
@@ -387,6 +391,10 @@
|
|||||||
"confirmOTPSuccess": "OTP confirmed successfully"
|
"confirmOTPSuccess": "OTP confirmed successfully"
|
||||||
},
|
},
|
||||||
"order": {
|
"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",
|
"title": "Order",
|
||||||
"newOrder": "New Order",
|
"newOrder": "New Order",
|
||||||
"aStaffMemberWillCollectTheCashFromYouAtYourTable": "A staff member will collect the cash from you at your table",
|
"aStaffMemberWillCollectTheCashFromYouAtYourTable": "A staff member will collect the cash from you at your table",
|
||||||
@@ -446,6 +454,7 @@
|
|||||||
"payButtonDescription": "Pay for your order"
|
"payButtonDescription": "Pay for your order"
|
||||||
},
|
},
|
||||||
"splitBill": {
|
"splitBill": {
|
||||||
|
"serviceFee": "Service Fee",
|
||||||
"title": "Split Bill",
|
"title": "Split Bill",
|
||||||
"description": "Split Bill",
|
"description": "Split Bill",
|
||||||
"splitBill": "Split Bill",
|
"splitBill": "Split Bill",
|
||||||
@@ -503,6 +512,10 @@
|
|||||||
"eCardAmount": "E-Card Amount",
|
"eCardAmount": "E-Card Amount",
|
||||||
"receiverName": "Receiver Name",
|
"receiverName": "Receiver Name",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"yourInformation": "Your Information"
|
"yourInformation": "Your Information",
|
||||||
|
"minimumAmountShouldBe1OMR": "Minimum amount should be 1 OMR",
|
||||||
|
"add": "Add",
|
||||||
|
"senderNameRequired": "Sender name is required",
|
||||||
|
"receiverNameRequired": "Receiver name is required"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const InvoiceIcon = ({ className, onClick }: InvoiceIconType) => {
|
|||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
d="M7.83317 7.41504H3.83317M5.1665 10.0817H3.83317M9.1665 4.74837H3.83317M11.8332 4.61504V11.5484C11.8332 12.6685 11.8332 13.2285 11.6152 13.6564C11.4234 14.0327 11.1175 14.3386 10.7412 14.5304C10.3133 14.7484 9.75328 14.7484 8.63317 14.7484H4.3665C3.2464 14.7484 2.68635 14.7484 2.25852 14.5304C1.8822 14.3386 1.57624 14.0327 1.38449 13.6564C1.1665 13.2285 1.1665 12.6685 1.1665 11.5484V4.61504C1.1665 3.49493 1.1665 2.93488 1.38449 2.50706C1.57624 2.13073 1.8822 1.82477 2.25852 1.63303C2.68635 1.41504 3.2464 1.41504 4.3665 1.41504H8.63317C9.75328 1.41504 10.3133 1.41504 10.7412 1.63303C11.1175 1.82477 11.4234 2.13073 11.6152 2.50706C11.8332 2.93488 11.8332 3.49493 11.8332 4.61504Z"
|
d="M7.83317 7.41504H3.83317M5.1665 10.0817H3.83317M9.1665 4.74837H3.83317M11.8332 4.61504V11.5484C11.8332 12.6685 11.8332 13.2285 11.6152 13.6564C11.4234 14.0327 11.1175 14.3386 10.7412 14.5304C10.3133 14.7484 9.75328 14.7484 8.63317 14.7484H4.3665C3.2464 14.7484 2.68635 14.7484 2.25852 14.5304C1.8822 14.3386 1.57624 14.0327 1.38449 13.6564C1.1665 13.2285 1.1665 12.6685 1.1665 11.5484V4.61504C1.1665 3.49493 1.1665 2.93488 1.38449 2.50706C1.57624 2.13073 1.8822 1.82477 2.25852 1.63303C2.68635 1.41504 3.2464 1.41504 4.3665 1.41504H8.63317C9.75328 1.41504 10.3133 1.41504 10.7412 1.63303C11.1175 1.82477 11.4234 2.13073 11.6152 2.50706C11.8332 2.93488 11.8332 3.49493 11.8332 4.61504Z"
|
||||||
stroke="#666666"
|
stroke="#333333"
|
||||||
strokeLinecap="round"
|
strokeLinecap="round"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const TimeIcon = ({ className, onClick }: TimeIconType) => {
|
|||||||
<g clipPath="url(#clip0_2448_7814)">
|
<g clipPath="url(#clip0_2448_7814)">
|
||||||
<path
|
<path
|
||||||
d="M8.50016 4.08171V8.08171L11.1668 9.41504M15.1668 8.08171C15.1668 11.7636 12.1821 14.7484 8.50016 14.7484C4.81826 14.7484 1.8335 11.7636 1.8335 8.08171C1.8335 4.39981 4.81826 1.41504 8.50016 1.41504C12.1821 1.41504 15.1668 4.39981 15.1668 8.08171Z"
|
d="M8.50016 4.08171V8.08171L11.1668 9.41504M15.1668 8.08171C15.1668 11.7636 12.1821 14.7484 8.50016 14.7484C4.81826 14.7484 1.8335 11.7636 1.8335 8.08171C1.8335 4.39981 4.81826 1.41504 8.50016 1.41504C12.1821 1.41504 15.1668 4.39981 15.1668 8.08171Z"
|
||||||
stroke="#666666"
|
stroke="#333333"
|
||||||
strokeLinecap="round"
|
strokeLinecap="round"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -16,8 +16,31 @@ export default function PaymentDetails({ order }: { order?: Order }) {
|
|||||||
<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} ${styles.totalRow}`}>
|
<div className={`${styles.summaryRow} ${styles.totalRow}`}>
|
||||||
<ProText strong>{t("cart.totalAmount")}</ProText>
|
<ProText
|
||||||
<ArabicPrice price={order?.total_price || 0} strong />
|
style={{
|
||||||
|
fontWeight: 600,
|
||||||
|
fontStyle: "SemiBold",
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
|
color: "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("cart.totalAmount")}
|
||||||
|
</ProText>
|
||||||
|
<ArabicPrice
|
||||||
|
price={order?.total_price || 0}
|
||||||
|
textStyle={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
|
color: "#434E5C",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -23,15 +23,17 @@ export default function CardDetailsPage() {
|
|||||||
const { giftDetails } = useAppSelector(selectCart);
|
const { giftDetails } = useAppSelector(selectCart);
|
||||||
const { isRTL } = useAppSelector((state) => state.locale);
|
const { isRTL } = useAppSelector((state) => state.locale);
|
||||||
const [currentIndex, setCurrentIndex] = useState(0);
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
const [isGiftAmountBottomSheetOpen, setIsGiftAmountBottomSheetOpen] = useState(false);
|
const [isGiftAmountBottomSheetOpen, setIsGiftAmountBottomSheetOpen] =
|
||||||
|
useState(false);
|
||||||
const { subdomain } = useParams();
|
const { subdomain } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
// Find the initial index based on selected cardId from gift details
|
// Find the initial index based on selected cardId from gift details
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cards && giftDetails?.cardId) {
|
if (cards && giftDetails?.cardId) {
|
||||||
const index = cards.findIndex(
|
const index = cards.findIndex(
|
||||||
(card) => card?.id?.toString() === giftDetails.cardId,
|
(card) => card?.id?.toString() === giftDetails.cardId.toString(),
|
||||||
);
|
);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
setCurrentIndex(index);
|
setCurrentIndex(index);
|
||||||
@@ -53,105 +55,137 @@ export default function CardDetailsPage() {
|
|||||||
|
|
||||||
const currentCard = cards && cards.length > 0 ? cards[currentIndex] : null;
|
const currentCard = cards && cards.length > 0 ? cards[currentIndex] : null;
|
||||||
|
|
||||||
const handleCheckout = useCallback(() => {
|
const handleCheckout = useCallback(async () => {
|
||||||
navigate(`/${subdomain}/checkout`);
|
try {
|
||||||
}, [subdomain]);
|
await form.validateFields();
|
||||||
|
navigate(`/${subdomain}/checkout`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}, [subdomain, form, navigate]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
receiverName: giftDetails?.receiverName,
|
||||||
|
senderName: giftDetails?.senderName,
|
||||||
|
senderPhone: giftDetails?.senderPhone,
|
||||||
|
senderEmail: giftDetails?.senderEmail,
|
||||||
|
receiverPhone: giftDetails?.receiverPhone,
|
||||||
|
message: giftDetails?.message,
|
||||||
|
amount: giftDetails?.amount,
|
||||||
|
cardId: giftDetails?.cardId,
|
||||||
|
giftType: giftDetails?.giftType,
|
||||||
|
isSecret: giftDetails?.isSecret,
|
||||||
|
});
|
||||||
|
}, [giftDetails?.receiverName, giftDetails?.senderName, form]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout>
|
<Layout>
|
||||||
<ProHeader>{t("cardDetails.title")}</ProHeader>
|
<ProHeader>{t("cardDetails.title")}</ProHeader>
|
||||||
<Layout.Content className={styles.checkoutContainer}>
|
<Layout.Content className={styles.checkoutContainer}>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
margin: "50px 28px 35px 28px",
|
margin: "50px 28px 35px 28px",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProText style={{ fontSize: 16, fontWeight: 600, color: "#333333" }}>
|
<ProText
|
||||||
{t("cardDetails.addGiftDetails")}
|
style={{ fontSize: 16, fontWeight: 600, color: "#333333" }}
|
||||||
</ProText>
|
>
|
||||||
<ProText style={{ fontSize: 14, fontWeight: 400, color: "#95949C" }}>
|
{t("cardDetails.addGiftDetails")}
|
||||||
{t("cardDetails.description")}
|
</ProText>
|
||||||
</ProText>
|
<ProText
|
||||||
</div>
|
style={{ fontSize: 14, fontWeight: 400, color: "#95949C" }}
|
||||||
{isLoading || !currentCard ? (
|
>
|
||||||
<div className={cardStyles.carouselContainer}>
|
{t("cardDetails.description")}
|
||||||
<Skeleton.Avatar
|
</ProText>
|
||||||
active
|
</div>
|
||||||
size={40}
|
{isLoading || !currentCard ? (
|
||||||
shape="circle"
|
<div className={cardStyles.carouselContainer}>
|
||||||
style={{ flexShrink: 0 }}
|
<Skeleton.Avatar
|
||||||
/>
|
|
||||||
<div className={cardStyles.cardWrapper}>
|
|
||||||
<Skeleton.Image
|
|
||||||
active
|
active
|
||||||
style={{
|
size={40}
|
||||||
width: 205,
|
shape="circle"
|
||||||
height: 134,
|
style={{ flexShrink: 0 }}
|
||||||
borderRadius: 8,
|
/>
|
||||||
}}
|
<div className={cardStyles.cardWrapper}>
|
||||||
|
<Skeleton.Image
|
||||||
|
active
|
||||||
|
style={{
|
||||||
|
width: 205,
|
||||||
|
height: 134,
|
||||||
|
borderRadius: 8,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Skeleton.Avatar
|
||||||
|
active
|
||||||
|
size={40}
|
||||||
|
shape="circle"
|
||||||
|
style={{ flexShrink: 0 }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Skeleton.Avatar
|
) : (
|
||||||
active
|
<div className={cardStyles.carouselContainer}>
|
||||||
size={40}
|
<Button
|
||||||
shape="circle"
|
type="text"
|
||||||
style={{ flexShrink: 0 }}
|
className={cardStyles.arrowButton}
|
||||||
/>
|
onClick={isRTL ? handleNext : handlePrevious}
|
||||||
</div>
|
icon={<BackIcon iconSize={24} />}
|
||||||
) : (
|
/>
|
||||||
<div className={cardStyles.carouselContainer}>
|
<div className={cardStyles.cardWrapper}>
|
||||||
<Button
|
<Image
|
||||||
type="text"
|
src={currentCard.imageURL}
|
||||||
className={cardStyles.arrowButton}
|
alt={currentCard.image}
|
||||||
onClick={isRTL ? handleNext : handlePrevious}
|
width={205}
|
||||||
icon={<BackIcon iconSize={24} />}
|
height={134}
|
||||||
/>
|
className={cardStyles.cardImage}
|
||||||
<div className={cardStyles.cardWrapper}>
|
/>
|
||||||
<Image
|
</div>
|
||||||
src={currentCard.imageURL}
|
<Button
|
||||||
alt={currentCard.image}
|
type="text"
|
||||||
width={205}
|
className={cardStyles.arrowButton}
|
||||||
height={134}
|
onClick={isRTL ? handlePrevious : handleNext}
|
||||||
className={cardStyles.cardImage}
|
icon={<NextIcon iconSize={24} />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
)}
|
||||||
type="text"
|
<Form
|
||||||
className={cardStyles.arrowButton}
|
form={form}
|
||||||
onClick={isRTL ? handlePrevious : handleNext}
|
layout="vertical"
|
||||||
icon={<NextIcon iconSize={24} />}
|
style={{ display: "flex", flexDirection: "column", gap: 16 }}
|
||||||
/>
|
>
|
||||||
</div>
|
{giftDetails?.giftType !== "items" && (
|
||||||
)}
|
<GiftAmountCard
|
||||||
<Form
|
onOpen={() => setIsGiftAmountBottomSheetOpen(true)}
|
||||||
layout="vertical"
|
/>
|
||||||
style={{ display: "flex", flexDirection: "column", gap: 16 }}
|
)}
|
||||||
>
|
<ReceivernformationCard />
|
||||||
{giftDetails?.giftType !== "items" && <GiftAmountCard onOpen={() => setIsGiftAmountBottomSheetOpen(true)} />}
|
<SenderformationCard />
|
||||||
<ReceivernformationCard />
|
<TimeEstimateCard />
|
||||||
<SenderformationCard />
|
</Form>
|
||||||
<TimeEstimateCard />
|
</Layout.Content>
|
||||||
</Form>
|
<Layout.Footer className={styles.checkoutButtonContainer}>
|
||||||
</Layout.Content>
|
<Button
|
||||||
<Layout.Footer className={styles.checkoutButtonContainer}>
|
type="primary"
|
||||||
<Button
|
shape="round"
|
||||||
type="primary"
|
className={styles.checkoutButton}
|
||||||
shape="round"
|
onClick={handleCheckout}
|
||||||
className={styles.checkoutButton}
|
>
|
||||||
onClick={handleCheckout}
|
{t("cardDetails.checkout")}
|
||||||
>
|
</Button>
|
||||||
{t("cardDetails.checkout")}
|
</Layout.Footer>
|
||||||
</Button>
|
</Layout>
|
||||||
</Layout.Footer>
|
<GiftAmountBottomSheet
|
||||||
</Layout>
|
isOpen={isGiftAmountBottomSheetOpen}
|
||||||
<GiftAmountBottomSheet isOpen={isGiftAmountBottomSheetOpen} onClose={() => setIsGiftAmountBottomSheetOpen(false)} />
|
onClose={() => setIsGiftAmountBottomSheetOpen(false)}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,18 +24,19 @@ export function GiftAmountBottomSheet({
|
|||||||
}: SplitBillChoiceBottomSheetProps) {
|
}: SplitBillChoiceBottomSheetProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { giftDetails, } = useAppSelector(selectCart);
|
const { giftDetails } = useAppSelector(selectCart);
|
||||||
const [amount, setAmount] = useState<string>(
|
const [amount, setAmount] = useState<string>(
|
||||||
giftDetails?.amount && giftDetails?.amount > 0 ? giftDetails?.amount?.toString() : "",
|
giftDetails?.amount && giftDetails?.amount > 0
|
||||||
|
? giftDetails?.amount?.toString()
|
||||||
|
: "",
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
const numAmount = parseFloat(amount) || 0;
|
const numAmount = parseFloat(amount) || 0;
|
||||||
dispatch(updateGiftDetails({amount: numAmount}));
|
dispatch(updateGiftDetails({ amount: numAmount }));
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProBottomSheet
|
<ProBottomSheet
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
@@ -51,13 +52,12 @@ export function GiftAmountBottomSheet({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: "20px",
|
padding: "20px 20px 0 20px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
gap: 20,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ display: "flex", flexDirection: "column", gap: 5 }}>
|
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
|
||||||
<ProText
|
<ProText
|
||||||
style={{
|
style={{
|
||||||
fontWeight: 400,
|
fontWeight: 400,
|
||||||
@@ -65,7 +65,7 @@ export function GiftAmountBottomSheet({
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
color:"#333333"
|
color: "#333333",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("cardDetails.enterCustomOucherAmount")}
|
{t("cardDetails.enterCustomOucherAmount")}
|
||||||
@@ -75,12 +75,24 @@ export function GiftAmountBottomSheet({
|
|||||||
value={amount}
|
value={amount}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
setAmount(value?.toString() || "");
|
setAmount(value?.toString() || "");
|
||||||
dispatch(updateSplitBillAmount(Number(value) || 0));
|
dispatch(updateGiftDetails({ amount: Number(value) || 0 }));
|
||||||
}}
|
}}
|
||||||
placeholder={t("cardDetails.amount")}
|
placeholder={t("cardDetails.amount")}
|
||||||
min={0}
|
min={0}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 500,
|
||||||
|
fontStyle: "Medium",
|
||||||
|
fontSize: 12,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#B1B0B6",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("cardDetails.minimumAmountShouldBe1OMR")}
|
||||||
|
</ProText>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -16,3 +16,9 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: -7px;
|
||||||
|
right: 5px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,23 +5,52 @@ import styles from "./GiftAmountCard.module.css";
|
|||||||
import ArabicPrice from "components/ArabicPrice";
|
import ArabicPrice from "components/ArabicPrice";
|
||||||
import ProText from "components/ProText";
|
import ProText from "components/ProText";
|
||||||
import EditIcon from "components/Icons/EditIcon";
|
import EditIcon from "components/Icons/EditIcon";
|
||||||
|
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||||
|
import { updateGiftDetails } from "features/order/orderSlice";
|
||||||
|
import { useState, useEffect, useMemo } from "react";
|
||||||
|
|
||||||
export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const dispatch = useAppDispatch();
|
||||||
|
const { giftDetails } = useAppSelector((state) => state.order);
|
||||||
|
const [selectedAmount, setSelectedAmount] = useState<number | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const amount = giftDetails?.amount;
|
||||||
|
if (amount === 10 || amount === 20 || amount === 30) {
|
||||||
|
setSelectedAmount(amount);
|
||||||
|
} else {
|
||||||
|
setSelectedAmount(null);
|
||||||
|
}
|
||||||
|
}, [giftDetails?.amount]);
|
||||||
|
|
||||||
|
const handleAmountClick = (amount: number) => {
|
||||||
|
setSelectedAmount(amount);
|
||||||
|
dispatch(updateGiftDetails({ amount }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const isDefaultAmount = useMemo(() => {
|
||||||
|
const amount = giftDetails?.amount;
|
||||||
|
return amount === 10 || amount === 20 || amount === 30;
|
||||||
|
}, [giftDetails?.amount]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProInputCard title={t("cardDetails.eCardAmount")}>
|
<ProInputCard title={t("cardDetails.eCardAmount")}>
|
||||||
<div className={styles.customerInformationCard}>
|
<div className={styles.customerInformationCard}>
|
||||||
<Button
|
<Button
|
||||||
|
onClick={() => handleAmountClick(10)}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 100,
|
borderRadius: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
border: "none",
|
border: "none",
|
||||||
backgroundColor: "#5F6C7B0D",
|
backgroundColor:
|
||||||
|
selectedAmount === 10 && isDefaultAmount
|
||||||
|
? "#FFB7001F"
|
||||||
|
: "#5F6C7B0D",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArabicPrice
|
<ArabicPrice
|
||||||
price={10.00}
|
price={10.0}
|
||||||
textStyle={{
|
textStyle={{
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
fontStyle: "Medium",
|
fontStyle: "Medium",
|
||||||
@@ -29,20 +58,27 @@ export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
|||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
color: "#5F6C7B",
|
color:
|
||||||
|
selectedAmount === 10 && isDefaultAmount
|
||||||
|
? "#CC9300"
|
||||||
|
: "#5F6C7B",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
onClick={() => handleAmountClick(20)}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 100,
|
borderRadius: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
border: "none",
|
border: "none",
|
||||||
backgroundColor: "#5F6C7B0D",
|
backgroundColor:
|
||||||
|
selectedAmount === 20 && isDefaultAmount
|
||||||
|
? "#FFB7001F"
|
||||||
|
: "#5F6C7B0D",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArabicPrice
|
<ArabicPrice
|
||||||
price={20.00}
|
price={20.0}
|
||||||
textStyle={{
|
textStyle={{
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
fontStyle: "Medium",
|
fontStyle: "Medium",
|
||||||
@@ -50,20 +86,27 @@ export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
|||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
color: "#5F6C7B",
|
color:
|
||||||
|
selectedAmount === 20 && isDefaultAmount
|
||||||
|
? "#CC9300"
|
||||||
|
: "#5F6C7B",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
onClick={() => handleAmountClick(30)}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 100,
|
borderRadius: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
border: "none",
|
border: "none",
|
||||||
backgroundColor: "#5F6C7B0D",
|
backgroundColor:
|
||||||
|
selectedAmount === 30 && isDefaultAmount
|
||||||
|
? "#FFB7001F"
|
||||||
|
: "#5F6C7B0D",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArabicPrice
|
<ArabicPrice
|
||||||
price={30.00}
|
price={30.0}
|
||||||
textStyle={{
|
textStyle={{
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
fontStyle: "Medium",
|
fontStyle: "Medium",
|
||||||
@@ -71,7 +114,10 @@ export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
|||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
color: "#5F6C7B",
|
color:
|
||||||
|
selectedAmount === 30 && isDefaultAmount
|
||||||
|
? "#CC9300"
|
||||||
|
: "#5F6C7B",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -83,23 +129,36 @@ export default function GiftAmountCard({ onOpen }: { onOpen: () => void }) {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
height: 40,
|
height: 40,
|
||||||
border: "none",
|
border: "none",
|
||||||
backgroundColor: "#030014",
|
backgroundColor:
|
||||||
|
giftDetails?.amount && !isDefaultAmount ? "#FFB7001F" : "#030014",
|
||||||
}}
|
}}
|
||||||
icon={<EditIcon className={styles.editIcon} color="#FFF" />}
|
icon={
|
||||||
|
giftDetails?.amount && !isDefaultAmount ? (
|
||||||
|
<EditIcon
|
||||||
|
className={styles.editIcon}
|
||||||
|
color={
|
||||||
|
giftDetails?.amount && !isDefaultAmount ? "#CC9300" : "#FFF"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
) : undefined
|
||||||
|
}
|
||||||
iconPlacement="start"
|
iconPlacement="start"
|
||||||
onClick={onOpen}
|
onClick={onOpen}
|
||||||
>
|
>
|
||||||
<ProText
|
<ProText
|
||||||
style={{
|
style={{
|
||||||
color: "#FFF",
|
color: giftDetails?.amount && !isDefaultAmount ? "#CC9300" : "#FFF",
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
fontStyle: "Medium",
|
fontStyle: "Medium",
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("cardDetails.costumeAmount")}
|
{giftDetails?.amount && !isDefaultAmount
|
||||||
|
? giftDetails?.amount
|
||||||
|
: t("cardDetails.costumeAmount")}
|
||||||
</ProText>
|
</ProText>
|
||||||
</Button>
|
</Button>
|
||||||
</ProInputCard>
|
</ProInputCard>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function ReceivernformationCard() {
|
|||||||
return (
|
return (
|
||||||
<ProInputCard title={t("cardDetails.receiverInformation")}>
|
<ProInputCard title={t("cardDetails.receiverInformation")}>
|
||||||
<div className={styles.customerInformationCard}>
|
<div className={styles.customerInformationCard}>
|
||||||
<Form.Item name="receiverName">
|
<Form.Item name="receiverName" rules={[{ required: true, message: t("cardDetails.receiverNameRequired") }]}>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t("cardDetails.receiverName")}
|
placeholder={t("cardDetails.receiverName")}
|
||||||
size="large"
|
size="large"
|
||||||
|
|||||||
@@ -15,7 +15,12 @@ export default function SenderformationCard() {
|
|||||||
return (
|
return (
|
||||||
<ProInputCard title={t("cardDetails.yourInformation")}>
|
<ProInputCard title={t("cardDetails.yourInformation")}>
|
||||||
<div className={styles.customerInformationCard}>
|
<div className={styles.customerInformationCard}>
|
||||||
<Form.Item name="senderName">
|
<Form.Item
|
||||||
|
name="senderName"
|
||||||
|
rules={[
|
||||||
|
{ required: true, message: t("cardDetails.senderNameRequired") },
|
||||||
|
]}
|
||||||
|
>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t("cardDetails.yourName")}
|
placeholder={t("cardDetails.yourName")}
|
||||||
size="large"
|
size="large"
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ export default function ECardList() {
|
|||||||
display: "grid",
|
display: "grid",
|
||||||
gridTemplateColumns: "1fr 1fr",
|
gridTemplateColumns: "1fr 1fr",
|
||||||
padding: "8px",
|
padding: "8px",
|
||||||
|
placeItems: "center",
|
||||||
|
gap: "8px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{eGiftCards?.map((card: EGiftCard) => (
|
{eGiftCards?.map((card: EGiftCard) => (
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
|
height: calc(92vh - 80px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cartLayout {
|
.cartLayout {
|
||||||
|
|||||||
@@ -64,11 +64,6 @@ export default function TableNumberCard() {
|
|||||||
>
|
>
|
||||||
{isEditing || table === "" ? (
|
{isEditing || table === "" ? (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={
|
|
||||||
orderType === OrderType.DineIn
|
|
||||||
? t("cart.tableNumber")
|
|
||||||
: t("cart.selectCompany")
|
|
||||||
}
|
|
||||||
name="table"
|
name="table"
|
||||||
required
|
required
|
||||||
rules={[
|
rules={[
|
||||||
@@ -81,7 +76,6 @@ export default function TableNumberCard() {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
initialValue={table}
|
initialValue={table}
|
||||||
style={{ position: "relative", top: -5 }}
|
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
value={table}
|
value={table}
|
||||||
@@ -103,9 +97,8 @@ export default function TableNumberCard() {
|
|||||||
borderRadius: 888,
|
borderRadius: 888,
|
||||||
}}
|
}}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
console.log(value);
|
|
||||||
dispatch(updateTables(value));
|
dispatch(updateTables(value));
|
||||||
setIsEditing(false);
|
if(value) setIsEditing(false);
|
||||||
}}
|
}}
|
||||||
onClear={() => {
|
onClear={() => {
|
||||||
dispatch(removeTable());
|
dispatch(removeTable());
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function SpecialRequestCard() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProInputCard
|
<ProInputCard
|
||||||
title={t("cart.specialRequest")}
|
title={t("cart.addSpecialRequestOptional")}
|
||||||
dividerStyle={{ margin: "5px 0 0 0" }}
|
dividerStyle={{ margin: "5px 0 0 0" }}
|
||||||
>
|
>
|
||||||
<Form.Item name="specialRequest" style={{ marginTop: 12 }}>
|
<Form.Item name="specialRequest" style={{ marginTop: 12 }}>
|
||||||
|
|||||||
@@ -117,17 +117,6 @@ export default function YouMightAlsoLike() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.youMightAlsoLikeTitle}>
|
|
||||||
<ProText
|
|
||||||
strong
|
|
||||||
style={{
|
|
||||||
fontSize: isMobile ? 18 : isTablet ? 18 : 20,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("cart.youMightAlsoLike")}
|
|
||||||
</ProText>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
position: "relative",
|
position: "relative",
|
||||||
|
|||||||
@@ -32,14 +32,13 @@ export default function BriefMenuCard() {
|
|||||||
<>
|
<>
|
||||||
<ProInputCard
|
<ProInputCard
|
||||||
title={t("checkout.orderSummary")}
|
title={t("checkout.orderSummary")}
|
||||||
dividerStyle={{ margin: "5px 0 0 0" }}
|
dividerStyle={{ margin: "3px 0 16px 0" }}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
padding: "16px 0",
|
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (orderId && location.pathname.includes("/order/")) {
|
if (orderId && location.pathname.includes("/order/")) {
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ import { useNavigate, useParams } from "react-router-dom";
|
|||||||
import InvoiceIcon from "components/Icons/order/InvoiceIcon";
|
import InvoiceIcon from "components/Icons/order/InvoiceIcon";
|
||||||
import BackIcon from "components/Icons/BackIcon";
|
import BackIcon from "components/Icons/BackIcon";
|
||||||
import NextIcon from "components/Icons/NextIcon";
|
import NextIcon from "components/Icons/NextIcon";
|
||||||
import { useMemo } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import CardAmountIcon from "components/Icons/CardAmountIcon";
|
import CardAmountIcon from "components/Icons/CardAmountIcon";
|
||||||
import ArabicPrice from "components/ArabicPrice";
|
import ArabicPrice from "components/ArabicPrice";
|
||||||
|
import { GiftAmountBottomSheet } from "pages/CardDetails/components/GiftAmountBottomSheet";
|
||||||
|
|
||||||
export function GiftCard() {
|
export function GiftCard() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -28,13 +29,32 @@ export function GiftCard() {
|
|||||||
const totalItems = useMemo(() => {
|
const totalItems = useMemo(() => {
|
||||||
return items.length || 0;
|
return items.length || 0;
|
||||||
}, [items]);
|
}, [items]);
|
||||||
|
const [isGiftAmountBottomSheetOpen, setIsGiftAmountBottomSheetOpen] =
|
||||||
|
useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProInputCard title={t("address.giftDetails")}>
|
<ProInputCard title={t("address.giftDetails")}>
|
||||||
<div className={styles.orderNotes}>
|
<div
|
||||||
<Image src={currentCard?.imageURL} height={42} width={64} style={{height: 42, width: 64}} />
|
className={styles.orderNotes}
|
||||||
<div style={{ display: "flex", flexDirection: "column", gap: 4, width: "100%" }}>
|
onClick={() => {
|
||||||
|
navigate(`/${subdomain}/card-details`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={currentCard?.imageURL}
|
||||||
|
height={42}
|
||||||
|
width={64}
|
||||||
|
style={{ height: 42, width: 64 }}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: 4,
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ProText
|
<ProText
|
||||||
style={{
|
style={{
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
@@ -90,93 +110,105 @@ export function GiftCard() {
|
|||||||
</div>
|
</div>
|
||||||
<Divider style={{ margin: "10px 0" }} />
|
<Divider style={{ margin: "10px 0" }} />
|
||||||
|
|
||||||
{giftDetails?.giftType === "items" && (
|
{giftDetails?.giftType === "vouchers" ||
|
||||||
<div
|
(giftDetails?.giftType === "itemsAndVouchers" && (
|
||||||
style={{
|
<div
|
||||||
display: "flex",
|
className={styles.orderNotes}
|
||||||
flexDirection: "row",
|
onClick={() => {
|
||||||
justifyContent: "space-between",
|
setIsGiftAmountBottomSheetOpen(true);
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
navigate(`/${subdomain}/cart`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ProText
|
|
||||||
style={{
|
|
||||||
fontWeight: 400,
|
|
||||||
fontStyle: "Regular",
|
|
||||||
fontSize: 12,
|
|
||||||
lineHeight: "140%",
|
|
||||||
letterSpacing: "0%",
|
|
||||||
color: "#777580",
|
|
||||||
cursor: "pointer",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<div
|
||||||
style={{
|
style={{
|
||||||
[isRTL ? "marginLeft" : "marginRight"]: 5,
|
height: 42,
|
||||||
position: "relative",
|
width: 64,
|
||||||
top: 3.5,
|
backgroundColor: "var(--background)",
|
||||||
|
borderRadius: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<InvoiceIcon />
|
<CardAmountIcon />
|
||||||
</span>
|
</div>
|
||||||
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
|
<div
|
||||||
</ProText>
|
style={{
|
||||||
{isRTL ? <BackIcon /> : <NextIcon />}
|
display: "flex",
|
||||||
</div>
|
flexDirection: "column",
|
||||||
)}
|
gap: 4,
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 500,
|
||||||
|
fontStyle: "Medium",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#777580",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("checkout.cardBalance")}
|
||||||
|
</ProText>
|
||||||
|
|
||||||
{giftDetails?.giftType === "vouchers" && (
|
<ProText
|
||||||
<div className={styles.orderNotes}>
|
style={{
|
||||||
<div
|
fontWeight: 500,
|
||||||
style={{
|
fontStyle: "Medium",
|
||||||
height: 42,
|
fontSize: 14,
|
||||||
width: 64,
|
lineHeight: "140%",
|
||||||
backgroundColor: "var(--background)",
|
letterSpacing: "0%",
|
||||||
borderRadius: 8,
|
color: "#333333",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CardAmountIcon />
|
<ArabicPrice price={giftDetails?.amount || 0} />
|
||||||
|
</ProText>
|
||||||
|
</div>
|
||||||
|
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<Divider style={{ margin: "10px 0" }} />
|
||||||
|
{giftDetails?.giftType === "items" ||
|
||||||
|
(giftDetails?.giftType === "itemsAndVouchers" && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "row",
|
||||||
gap: 4,
|
justifyContent: "space-between",
|
||||||
width: "100%",
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/${subdomain}/cart`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProText
|
<ProText
|
||||||
style={{
|
style={{
|
||||||
fontWeight: 500,
|
fontWeight: 400,
|
||||||
fontStyle: "Medium",
|
fontStyle: "Regular",
|
||||||
fontSize: 14,
|
fontSize: 12,
|
||||||
lineHeight: "140%",
|
lineHeight: "140%",
|
||||||
letterSpacing: "0%",
|
letterSpacing: "0%",
|
||||||
color: "#777580",
|
color: "#777580",
|
||||||
|
cursor: "pointer",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("checkout.giftSummary")}
|
<span
|
||||||
</ProText>
|
style={{
|
||||||
|
[isRTL ? "marginLeft" : "marginRight"]: 5,
|
||||||
<ProText
|
position: "relative",
|
||||||
style={{
|
top: 3.5,
|
||||||
fontWeight: 500,
|
}}
|
||||||
fontStyle: "Medium",
|
>
|
||||||
fontSize: 14,
|
<InvoiceIcon />
|
||||||
lineHeight: "140%",
|
</span>
|
||||||
letterSpacing: "0%",
|
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
|
||||||
color: "#333333",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ArabicPrice price={giftDetails?.amount || 0} />
|
|
||||||
</ProText>
|
</ProText>
|
||||||
|
{isRTL ? <BackIcon /> : <NextIcon />}
|
||||||
</div>
|
</div>
|
||||||
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
|
))}
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</ProInputCard>
|
</ProInputCard>
|
||||||
|
<GiftAmountBottomSheet
|
||||||
|
isOpen={isGiftAmountBottomSheetOpen}
|
||||||
|
onClose={() => setIsGiftAmountBottomSheetOpen(false)}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export default function useOrder() {
|
|||||||
pickupTime,
|
pickupTime,
|
||||||
pickupDate,
|
pickupDate,
|
||||||
pickupType,
|
pickupType,
|
||||||
|
giftDetails,
|
||||||
order,
|
order,
|
||||||
} = useAppSelector(selectCart);
|
} = useAppSelector(selectCart);
|
||||||
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
|
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
|
||||||
@@ -70,7 +71,7 @@ export default function useOrder() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
createOrder({
|
createOrder({
|
||||||
phone: mobilenumber || phone || order?.senderPhone,
|
phone: mobilenumber || phone || giftDetails?.senderPhone,
|
||||||
comment: specialRequest,
|
comment: specialRequest,
|
||||||
delivery_method: getDeliveryMethod(),
|
delivery_method: getDeliveryMethod(),
|
||||||
timeslot: "",
|
timeslot: "",
|
||||||
@@ -112,13 +113,13 @@ export default function useOrder() {
|
|||||||
delivery_address: location?.address,
|
delivery_address: location?.address,
|
||||||
...(orderType === OrderType.Gift
|
...(orderType === OrderType.Gift
|
||||||
? {
|
? {
|
||||||
receiverName: order?.receiverName,
|
receiverName: giftDetails?.receiverName,
|
||||||
receiverPhone: order?.receiverPhone,
|
receiverPhone: giftDetails?.receiverPhone,
|
||||||
specialMessage: order?.message,
|
specialMessage: giftDetails?.message,
|
||||||
keepNameSecret: order?.isSecret,
|
keepNameSecret: giftDetails?.isSecret,
|
||||||
senderEmail: order?.senderEmail,
|
senderEmail: giftDetails?.senderEmail,
|
||||||
senderPhone: order?.senderPhone,
|
senderPhone: giftDetails?.senderPhone,
|
||||||
senderName: order?.senderName,
|
senderName: giftDetails?.senderName,
|
||||||
dineType: orderType,
|
dineType: orderType,
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
@@ -173,7 +174,7 @@ export default function useOrder() {
|
|||||||
orderType,
|
orderType,
|
||||||
restaurantID,
|
restaurantID,
|
||||||
items,
|
items,
|
||||||
order,
|
giftDetails,
|
||||||
discount.isDiscount,
|
discount.isDiscount,
|
||||||
discount.isGift,
|
discount.isGift,
|
||||||
discount.value,
|
discount.value,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function OrderDetails() {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
padding: 8
|
padding: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Space orientation="vertical" size="small">
|
<Space orientation="vertical" size="small">
|
||||||
@@ -123,10 +123,20 @@ export default function OrderDetails() {
|
|||||||
[isRTL ? "right" : "left"]: 8,
|
[isRTL ? "right" : "left"]: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArabicPrice
|
<Button
|
||||||
price={item.price}
|
shape="circle"
|
||||||
style={{ fontStyle: "bold" }}
|
iconPlacement="start"
|
||||||
/>
|
size="small"
|
||||||
|
className={styles.addButton}
|
||||||
|
style={{
|
||||||
|
background: "#F5F5F6",
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
border: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText style={{color: "#1F1C2E"}}>{item.qty} </ProText>
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
<div style={{ position: "relative" }}>
|
<div style={{ position: "relative" }}>
|
||||||
|
|||||||
146
src/pages/order/components/SplitBillParticipantsBottomSheet.tsx
Normal file
146
src/pages/order/components/SplitBillParticipantsBottomSheet.tsx
Normal file
@@ -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 (
|
||||||
|
<ProBottomSheet
|
||||||
|
isOpen={isOpen}
|
||||||
|
onClose={onClose}
|
||||||
|
title={t("order.whosPaidTheirShareSplitBill")}
|
||||||
|
showCloseButton={true}
|
||||||
|
initialSnap={1}
|
||||||
|
height={285}
|
||||||
|
snapPoints={[285]}
|
||||||
|
contentStyle={{
|
||||||
|
padding: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: "20px",
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: 20,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className={styles.inviteToBill}>
|
||||||
|
<Button
|
||||||
|
shape="circle"
|
||||||
|
iconPlacement="start"
|
||||||
|
size="small"
|
||||||
|
className={styles.addButton}
|
||||||
|
style={{
|
||||||
|
background: "#F9F9FA",
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
border: "none",
|
||||||
|
color: "#FFB700",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText style={{ color: "#1F1C2E" }}> 1 </ProText>
|
||||||
|
</Button>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: 4,
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 500,
|
||||||
|
fontStyle: "Medium",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#777580",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("order.personHasPaid")}
|
||||||
|
</ProText>
|
||||||
|
</div>
|
||||||
|
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
backgroundColor: "var(--background)",
|
||||||
|
padding: "20px",
|
||||||
|
opacity: 1,
|
||||||
|
gap: 8,
|
||||||
|
borderTopLeftRadius: 24,
|
||||||
|
borderTopRightRadius: 24,
|
||||||
|
paddingTop: 12,
|
||||||
|
paddingRight: 24,
|
||||||
|
paddingBottom: 24,
|
||||||
|
paddingLeft: 24,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className={styles.summaryRow}>
|
||||||
|
<ProText style={taxesChargesStyle}>
|
||||||
|
{t("splitBill.totalBill")}
|
||||||
|
</ProText>
|
||||||
|
<ArabicPrice price={0} textStyle={taxesChargesStyle} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.summaryRow}>
|
||||||
|
<ProText style={taxesChargesStyle}>
|
||||||
|
{t("splitBill.serviceFee")}
|
||||||
|
</ProText>
|
||||||
|
<ArabicPrice price={0} textStyle={taxesChargesStyle} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.summaryRow}>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("splitBill.remainingToPay")}
|
||||||
|
</ProText>
|
||||||
|
<ArabicPrice
|
||||||
|
price={0}
|
||||||
|
textStyle={taxesChargesStyle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<ProText style={taxesChargesStyle}>
|
||||||
|
{t("splitBill.includesAllOfTaxesCharges")}
|
||||||
|
</ProText>
|
||||||
|
</div>
|
||||||
|
</ProBottomSheet>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -112,7 +112,17 @@ export default function Stepper({ statuses = [] }: StepperProps) {
|
|||||||
{steps.map((step, index) => (
|
{steps.map((step, index) => (
|
||||||
<Fragment key={`label-${step.key}`}>
|
<Fragment key={`label-${step.key}`}>
|
||||||
<Col>
|
<Col>
|
||||||
<ProText type={step.isPending ? "secondary" : undefined}>
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
|
color: step.isPending ? "#99A2AE" : "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{step.label}
|
{step.label}
|
||||||
</ProText>
|
</ProText>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -314,17 +314,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.orderContent {
|
.orderContent {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CheckoutButton Styles */
|
/* CheckoutButton Styles */
|
||||||
|
|
||||||
.checkoutButton{
|
.checkoutButton {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,3 +348,13 @@
|
|||||||
:global(.darkApp) .checkoutButtonContainer {
|
:global(.darkApp) .checkoutButtonContainer {
|
||||||
background-color: #000000 !important;
|
background-color: #000000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inviteToBill {
|
||||||
|
gap: 16px;
|
||||||
|
opacity: 1;
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
place-items: center;
|
||||||
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ import { QRBottomSheet } from "pages/pay/components/splitBill/QRBottomSheet";
|
|||||||
import NewRateIcon from "components/Icons/order/NewRateIcon";
|
import NewRateIcon from "components/Icons/order/NewRateIcon";
|
||||||
import NoteIcon from "components/Icons/NoteIcon";
|
import NoteIcon from "components/Icons/NoteIcon";
|
||||||
import SuccessIcon from "components/Icons/SuccessIcon";
|
import SuccessIcon from "components/Icons/SuccessIcon";
|
||||||
|
import ProInputCard from "components/ProInputCard/ProInputCard";
|
||||||
|
import { SplitBillParticipantsBottomSheet } from "./components/SplitBillParticipantsBottomSheet";
|
||||||
|
|
||||||
export default function OrderPage() {
|
export default function OrderPage() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -47,7 +49,7 @@ export default function OrderPage() {
|
|||||||
const hasRefetchedRef = useRef(false);
|
const hasRefetchedRef = useRef(false);
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [isRateOrderOpen, setIsRateOrderOpen] = useState(false);
|
const [isRateOrderOpen, setIsRateOrderOpen] = useState(false);
|
||||||
|
const [isSplitBillParticipantsBottomSheetOpen, setIsSplitBillParticipantsBottomSheetOpen] = useState(false);
|
||||||
const { data: orderDetails } = useGetOrderDetailsQuery(
|
const { data: orderDetails } = useGetOrderDetailsQuery(
|
||||||
{
|
{
|
||||||
orderID: orderId || "",
|
orderID: orderId || "",
|
||||||
@@ -242,28 +244,31 @@ export default function OrderPage() {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
gap: "1rem",
|
gap: "1rem",
|
||||||
backgroundColor: "rgba(255, 183, 0, 0.08)",
|
backgroundColor: "#f5f5f6",
|
||||||
borderRadius: "12px",
|
borderRadius: "12px",
|
||||||
padding: 16,
|
padding: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button type="text" shape="circle">
|
||||||
type="text"
|
|
||||||
shape="circle"
|
|
||||||
style={{
|
|
||||||
backgroundColor: "rgba(255, 183, 0, 0.08)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Image
|
<Image
|
||||||
src={orderDetails?.restaurant_iimage}
|
src={orderDetails?.restaurant_iimage}
|
||||||
className={styles.profileImage}
|
className={styles.profileImage}
|
||||||
width={50}
|
width={40}
|
||||||
height={50}
|
height={40}
|
||||||
preview={false}
|
preview={false}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<div>
|
<div>
|
||||||
<ProText style={{ fontSize: "1rem" }}>
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontFamily: "Bold/Caption Bold",
|
||||||
|
fontSize: "12px",
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
fontWeight: "bold",
|
||||||
|
color: "#434E5C",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{t("order.yourOrderFromFascanoRestaurant")}
|
{t("order.yourOrderFromFascanoRestaurant")}
|
||||||
</ProText>
|
</ProText>
|
||||||
<br />
|
<br />
|
||||||
@@ -319,27 +324,61 @@ export default function OrderPage() {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Flex>
|
</Flex>
|
||||||
) : (
|
) : (
|
||||||
<OrderDishIcon className={styles.orderDishIcon} />
|
<div style={{ margin: "56px 0" }}>
|
||||||
|
<OrderDishIcon className={styles.orderDishIcon} />
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<ProTitle
|
<ProTitle
|
||||||
level={5}
|
level={5}
|
||||||
style={{
|
style={{
|
||||||
fontWeight: 600,
|
fontWeight: 500,
|
||||||
fontSize: "18px",
|
fontStyle: "Medium",
|
||||||
|
fontSize: 18,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
marginBottom: "0.75rem",
|
marginBottom: "0.75rem",
|
||||||
|
color: "#333333",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("order.inProgressOrder")} (1)
|
{t("order.inProgressOrder")} (1)
|
||||||
</ProTitle>
|
</ProTitle>
|
||||||
<div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
gap: 8,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<InvoiceIcon className={styles.invoiceIcon} />
|
<InvoiceIcon className={styles.invoiceIcon} />
|
||||||
<ProText type="secondary" style={{ fontSize: "14px" }}>
|
<ProText
|
||||||
|
type="secondary"
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
|
color: "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
#{orderDetails?.order.id}
|
#{orderDetails?.order.id}
|
||||||
</ProText>
|
</ProText>
|
||||||
<TimeIcon className={styles.timeIcon} />
|
<TimeIcon className={styles.timeIcon} />
|
||||||
<ProText type="secondary" style={{ fontSize: "14px" }}>
|
<ProText
|
||||||
|
type="secondary"
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
textAlign: "center",
|
||||||
|
color: "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
ordered :- Today -{" "}
|
ordered :- Today -{" "}
|
||||||
{dayjs(orderDetails?.status[0]?.pivot?.created_at).format(
|
{dayjs(orderDetails?.status[0]?.pivot?.created_at).format(
|
||||||
"h:mm A",
|
"h:mm A",
|
||||||
@@ -459,31 +498,122 @@ export default function OrderPage() {
|
|||||||
|
|
||||||
<PaymentDetails order={orderDetails?.order} />
|
<PaymentDetails order={orderDetails?.order} />
|
||||||
|
|
||||||
<Card
|
{/* inviteToBill */}
|
||||||
className={styles.inviteToBillCard}
|
{!hasClosedStatus && (
|
||||||
onClick={() => setIsOpen(true)}
|
<ProInputCard
|
||||||
>
|
title={
|
||||||
<div
|
<>
|
||||||
style={{
|
<div
|
||||||
display: "flex",
|
style={{
|
||||||
flexDirection: "row",
|
display: "flex",
|
||||||
justifyContent: "center",
|
flexDirection: "column",
|
||||||
marginTop: 1,
|
marginBottom: 9,
|
||||||
}}
|
gap: 2 ,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontSize: "18px",
|
||||||
|
fontWeight: 500,
|
||||||
|
fontStyle: "Medium",
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("order.whosPaidTheirShareSplitBill")}
|
||||||
|
</ProText>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 12,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#777580",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("order.seeWhoPaidAndHowMuch")}
|
||||||
|
</ProText>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div style={{ display: "flex", flexDirection: "row", gap: 10 }}>
|
<div className={styles.inviteToBill}
|
||||||
<ProTitle
|
onClick={() => setIsSplitBillParticipantsBottomSheetOpen(true)}>
|
||||||
level={5}
|
<Button
|
||||||
|
shape="circle"
|
||||||
|
iconPlacement="start"
|
||||||
|
size="small"
|
||||||
|
className={styles.addButton}
|
||||||
style={{
|
style={{
|
||||||
marginTop: 1,
|
background: "#F9F9FA",
|
||||||
fontSize: 14,
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
border: "none",
|
||||||
|
color: "#FFB700",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("order.inviteToBill")}
|
<ProText style={{ color: "#1F1C2E" }}> 1 </ProText>
|
||||||
</ProTitle>
|
</Button>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: 4,
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 500,
|
||||||
|
fontStyle: "Medium",
|
||||||
|
fontSize: 14,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#777580",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("order.personHasPaid")}
|
||||||
|
</ProText>
|
||||||
|
</div>
|
||||||
|
{isRTL ? (
|
||||||
|
<BackIcon iconSize={24} />
|
||||||
|
) : (
|
||||||
|
<NextIcon iconSize={24} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<Button
|
||||||
</Card>
|
type="text"
|
||||||
|
style={{
|
||||||
|
height: 48,
|
||||||
|
width: "100%",
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: 8,
|
||||||
|
border: "1px solid #C0BFC4",
|
||||||
|
borderRadius: 888,
|
||||||
|
marginTop: 16,
|
||||||
|
}}
|
||||||
|
onClick={() => setIsOpen(true)}
|
||||||
|
>
|
||||||
|
<ProText
|
||||||
|
style={{
|
||||||
|
fontWeight: 400,
|
||||||
|
fontStyle: "Regular",
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
|
color: "#333333",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("order.inviteOthersToBill")}
|
||||||
|
</ProText>
|
||||||
|
</Button>
|
||||||
|
</ProInputCard>
|
||||||
|
)}
|
||||||
|
|
||||||
<QRBottomSheet isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
<QRBottomSheet isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
||||||
|
|
||||||
@@ -532,21 +662,24 @@ export default function OrderPage() {
|
|||||||
onClose={() => setIsRateOrderOpen(false)}
|
onClose={() => setIsRateOrderOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CancelOrderBottomSheet />
|
{!hasClosedStatus && <CancelOrderBottomSheet />}
|
||||||
</Layout.Content>
|
</Layout.Content>
|
||||||
<Layout.Footer className={styles.checkoutButtonContainer}>
|
{hasClosedStatus && (
|
||||||
<Button
|
<Layout.Footer className={styles.checkoutButtonContainer}>
|
||||||
type="primary"
|
<Button
|
||||||
shape="round"
|
type="primary"
|
||||||
className={styles.checkoutButton}
|
shape="round"
|
||||||
onClick={() => {
|
className={styles.checkoutButton}
|
||||||
navigate(`/${restaurant?.subdomain}/menu`);
|
onClick={() => {
|
||||||
}}
|
navigate(`/${restaurant?.subdomain}/menu`);
|
||||||
>
|
}}
|
||||||
{t("order.newOrder")}
|
>
|
||||||
</Button>
|
{t("order.newOrder")}
|
||||||
</Layout.Footer>
|
</Button>
|
||||||
|
</Layout.Footer>
|
||||||
|
)}
|
||||||
</Layout>
|
</Layout>
|
||||||
|
<SplitBillParticipantsBottomSheet isOpen={isSplitBillParticipantsBottomSheetOpen} onClose={() => setIsSplitBillParticipantsBottomSheetOpen(false)} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user