fix bottom sheets height
This commit is contained in:
@@ -40,7 +40,7 @@ export function CouponBottomSheet({
|
|||||||
title={t("cart.coupon")}
|
title={t("cart.coupon")}
|
||||||
showCloseButton={false}
|
showCloseButton={false}
|
||||||
initialSnap={1}
|
initialSnap={1}
|
||||||
height={"40vh"}
|
height={350}
|
||||||
snapPoints={["30vh"]}
|
snapPoints={["30vh"]}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ export default function DatePickerBottomSheet({
|
|||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
title={t("common.pickYourBirthday")}
|
title={t("common.pickYourBirthday")}
|
||||||
snapPoints={["55vh"]}
|
height={600}
|
||||||
|
snapPoints={[460]}
|
||||||
showCloseButton={true}
|
showCloseButton={true}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function TipBottomSheet({
|
|||||||
title={t("cart.tip")}
|
title={t("cart.tip")}
|
||||||
showCloseButton={false}
|
showCloseButton={false}
|
||||||
initialSnap={1}
|
initialSnap={1}
|
||||||
height={"45vh"}
|
height={370}
|
||||||
snapPoints={["30vh"]}
|
snapPoints={["30vh"]}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface ProBottomSheetProps {
|
|||||||
showHandle?: boolean;
|
showHandle?: boolean;
|
||||||
showCloseButton?: boolean;
|
showCloseButton?: boolean;
|
||||||
backdrop?: boolean;
|
backdrop?: boolean;
|
||||||
snapPoints?: string[];
|
snapPoints?: string[] | number[];
|
||||||
initialSnap?: number;
|
initialSnap?: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
themeName?: "light" | "dark";
|
themeName?: "light" | "dark";
|
||||||
@@ -23,11 +23,11 @@ export function ProBottomSheet({
|
|||||||
onClose,
|
onClose,
|
||||||
title,
|
title,
|
||||||
children,
|
children,
|
||||||
height = "50vh",
|
height = 500,
|
||||||
showHandle = true,
|
showHandle = true,
|
||||||
showCloseButton = true,
|
showCloseButton = true,
|
||||||
backdrop = true,
|
backdrop = true,
|
||||||
snapPoints = ["50vh"],
|
snapPoints = [500],
|
||||||
initialSnap = 0,
|
initialSnap = 0,
|
||||||
className = "",
|
className = "",
|
||||||
}: ProBottomSheetProps) {
|
}: ProBottomSheetProps) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Button, Input } from "antd";
|
import { Button, Input } from "antd";
|
||||||
|
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
|
||||||
|
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export function BottomSheet({
|
|||||||
title={t("cart.specialRequest")}
|
title={t("cart.specialRequest")}
|
||||||
showCloseButton={false}
|
showCloseButton={false}
|
||||||
initialSnap={1}
|
initialSnap={1}
|
||||||
height={"40vh"}
|
height={370}
|
||||||
snapPoints={["30vh"]}
|
snapPoints={["30vh"]}
|
||||||
>
|
>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function BottomSheet({
|
|||||||
title={t("cart.selectTimeEstimate")}
|
title={t("cart.selectTimeEstimate")}
|
||||||
showCloseButton={true}
|
showCloseButton={true}
|
||||||
initialSnap={1}
|
initialSnap={1}
|
||||||
height={"510px"}
|
height={510}
|
||||||
snapPoints={["65vh"]}
|
snapPoints={["65vh"]}
|
||||||
>
|
>
|
||||||
<Content onSave={onSave} initialDate={initialDate} onClose={onClose} />
|
<Content onSave={onSave} initialDate={initialDate} onClose={onClose} />
|
||||||
|
|||||||
@@ -11,10 +11,18 @@ export default function useOrder() {
|
|||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const restaurantID = localStorage.getItem("restaurantID");
|
const restaurantID = localStorage.getItem("restaurantID");
|
||||||
const { mobilenumber, user_uuid } = JSON.parse(
|
const { mobilenumber, user_uuid } = JSON.parse(
|
||||||
localStorage.getItem("customer") || "{}"
|
localStorage.getItem("customer") || "{}",
|
||||||
) as Customer;
|
) as Customer;
|
||||||
const { items, coupon, tip, tables, specialRequest, phone } =
|
const {
|
||||||
useAppSelector(selectCart);
|
items,
|
||||||
|
coupon,
|
||||||
|
tip,
|
||||||
|
tables,
|
||||||
|
specialRequest,
|
||||||
|
phone,
|
||||||
|
estimateTime,
|
||||||
|
officeDetails,
|
||||||
|
} = useAppSelector(selectCart);
|
||||||
|
|
||||||
const [createOrder] = useCreateOrderMutation();
|
const [createOrder] = useCreateOrderMutation();
|
||||||
|
|
||||||
@@ -33,18 +41,20 @@ export default function useOrder() {
|
|||||||
items: items.map((i) => ({
|
items: items.map((i) => ({
|
||||||
...i,
|
...i,
|
||||||
qty: i.quantity,
|
qty: i.quantity,
|
||||||
|
extras: i.extras || [],
|
||||||
|
extrasgroup: i.extrasgroup || [],
|
||||||
})),
|
})),
|
||||||
office_no: "",
|
office_no: officeDetails?.officeNo || "",
|
||||||
vatvalue: 0,
|
vatvalue: 0,
|
||||||
discountGiftCode: "",
|
discountGiftCode: "",
|
||||||
paymentType: "cod",
|
paymentType: "cod",
|
||||||
uuid: user_uuid,
|
uuid: user_uuid,
|
||||||
pickup_comments: "",
|
pickup_comments: "",
|
||||||
pickup_time: "",
|
pickup_time: estimateTime,
|
||||||
delivery_pickup_interval: "",
|
delivery_pickup_interval: "",
|
||||||
orderPrice: items.reduce(
|
orderPrice: items.reduce(
|
||||||
(acc, item) => acc + item.price * item.quantity,
|
(acc, item) => acc + item.price * item.quantity,
|
||||||
0
|
0,
|
||||||
),
|
),
|
||||||
useWallet: 0,
|
useWallet: 0,
|
||||||
tip,
|
tip,
|
||||||
@@ -59,13 +69,16 @@ export default function useOrder() {
|
|||||||
}, [
|
}, [
|
||||||
createOrder,
|
createOrder,
|
||||||
mobilenumber,
|
mobilenumber,
|
||||||
|
phone,
|
||||||
coupon,
|
coupon,
|
||||||
specialRequest,
|
specialRequest,
|
||||||
tables,
|
tables,
|
||||||
id,
|
id,
|
||||||
restaurantID,
|
restaurantID,
|
||||||
items,
|
items,
|
||||||
|
officeDetails?.officeNo,
|
||||||
user_uuid,
|
user_uuid,
|
||||||
|
estimateTime,
|
||||||
tip,
|
tip,
|
||||||
dispatch,
|
dispatch,
|
||||||
router,
|
router,
|
||||||
|
|||||||
Reference in New Issue
Block a user