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