remove extra bottom sheet in checkout page make all them inside the page iteslef

This commit is contained in:
2025-12-02 01:51:14 +03:00
parent cf5babeaa5
commit 2af2c34826
8 changed files with 266 additions and 43 deletions

View File

@@ -13,6 +13,7 @@ import { useCreateOrderMutation } from "redux/api/others";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import { PAYMENT_CONFIRMATION_URL } from "utils/constants";
import { Customer } from "../../otp/types";
import { Variant } from "utils/types/appTypes";
export default function useOrder() {
const dispatch = useAppDispatch();
@@ -31,15 +32,14 @@ export default function useOrder() {
specialRequest,
phone,
estimateTime,
officeDetails,
orderType,
giftDetails,
location,
discount,
plateCar,
pickupTime,
pickupDate,
pickupType,
order,
} = useAppSelector(selectCart);
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
const { useLoyaltyPoints } = useAppSelector(selectCart);
@@ -70,7 +70,7 @@ export default function useOrder() {
});
createOrder({
phone: mobilenumber || phone || giftDetails?.senderPhone,
phone: mobilenumber || phone || order?.senderPhone,
comment: specialRequest,
delivery_method: getDeliveryMethod(),
timeslot: "",
@@ -85,9 +85,10 @@ export default function useOrder() {
extras: i.extras?.map((e) => e.id) || [],
extrasgroup: i.extrasgroup || [],
order_item_comment: i.comment || "",
variant: i.variant?.id || "",
variant: (i.variant as Variant)?.id || "",
})),
office_no: officeDetails?.officeNo || "",
office_no: order?.officeNumber || "",
room_no: order?.roomNumber || "",
vatvalue: 0,
...(discount.isDiscount ? { couponID: coupon } : {}),
...(discount.isGift ? { discountGiftCode: coupon } : {}),
@@ -111,13 +112,13 @@ export default function useOrder() {
delivery_address: location?.address,
...(orderType === OrderType.Gift
? {
receiverName: giftDetails?.receiverName,
receiverPhone: giftDetails?.receiverPhone,
specialMessage: giftDetails?.message,
keepNameSecret: giftDetails?.isSecret,
senderEmail: giftDetails?.senderEmail,
senderPhone: giftDetails?.senderPhone,
senderName: giftDetails?.senderName,
receiverName: order?.receiverName,
receiverPhone: order?.receiverPhone,
specialMessage: order?.message,
keepNameSecret: order?.isSecret,
senderEmail: order?.senderEmail,
senderPhone: order?.senderPhone,
senderName: order?.senderName,
dineType: orderType,
}
: {}),
@@ -166,20 +167,13 @@ export default function useOrder() {
createOrder,
mobilenumber,
phone,
giftDetails?.senderPhone,
giftDetails?.receiverName,
giftDetails?.receiverPhone,
giftDetails?.message,
giftDetails?.isSecret,
giftDetails?.senderEmail,
giftDetails?.senderName,
specialRequest,
getDeliveryMethod,
tables,
orderType,
restaurantID,
items,
officeDetails?.officeNo,
order,
discount.isDiscount,
discount.isGift,
discount.value,