cart refactor code
This commit is contained in:
33
src/pages/cart/components/timeEstimate/BottomSheet.tsx
Normal file
33
src/pages/cart/components/timeEstimate/BottomSheet.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
||||
import Content from "pages/cart/components/timeEstimate/Content.tsx";
|
||||
|
||||
interface EstimateTimeBottomSheetProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onSave: (date: Date, time: string) => void;
|
||||
initialDate?: Date;
|
||||
}
|
||||
|
||||
export function BottomSheet({
|
||||
isOpen,
|
||||
onClose,
|
||||
onSave,
|
||||
initialDate = new Date(),
|
||||
}: EstimateTimeBottomSheetProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<ProBottomSheet
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
title={t("cart.selectTimeEstimate")}
|
||||
showCloseButton={true}
|
||||
initialSnap={1}
|
||||
height={"50vh"}
|
||||
snapPoints={["50vh", "60vh"]}
|
||||
>
|
||||
<Content onSave={onSave} initialDate={initialDate} onClose={onClose} />
|
||||
</ProBottomSheet>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user