From 5e43aeb5a0555c41ba8b0dc285fa2a2d151c9ae5 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Wed, 15 Oct 2025 22:07:42 +0300 Subject: [PATCH] fix the TimeEstimateCard opening --- .../ProRatioGroups/ProRatioGroups.tsx | 17 +++++++++++++++-- .../components/timeEstimate/BottomSheet.tsx | 2 +- .../timeEstimate/TimeEstimateCard.tsx | 8 +++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/components/ProRatioGroups/ProRatioGroups.tsx b/src/components/ProRatioGroups/ProRatioGroups.tsx index f5c1555..d0ac9b7 100644 --- a/src/components/ProRatioGroups/ProRatioGroups.tsx +++ b/src/components/ProRatioGroups/ProRatioGroups.tsx @@ -1,19 +1,32 @@ -import { Radio, Space } from "antd"; +import { Radio, RadioChangeEvent, Space } from "antd"; import ProText from "components/ProText"; import styles from "./ProRatioGroups.module.css"; interface ProRatioGroupsProps { options: { label: string; value: string; price?: string }[]; onRatioClick?: (value: string) => void; + onChange?: (e: RadioChangeEvent) => void; value?: string; } const ProRatioGroups = ({ options, onRatioClick, + onChange, value, ...props }: ProRatioGroupsProps) => { + const handleChange = (e: RadioChangeEvent) => { + // If onChange is provided (from Form.Item), use it + if (onChange) { + onChange(e); + } + // Also call onRatioClick if provided (for backward compatibility) + if (onRatioClick) { + onRatioClick(e.target.value); + } + }; + return (
onRatioClick?.(e.target.value)} + onChange={handleChange} {...props} > diff --git a/src/pages/cart/components/timeEstimate/BottomSheet.tsx b/src/pages/cart/components/timeEstimate/BottomSheet.tsx index 13db96a..5600890 100644 --- a/src/pages/cart/components/timeEstimate/BottomSheet.tsx +++ b/src/pages/cart/components/timeEstimate/BottomSheet.tsx @@ -24,7 +24,7 @@ export function BottomSheet({ title={t("cart.selectTimeEstimate")} showCloseButton={true} initialSnap={1} - height={510} + height={555} snapPoints={["65vh"]} > diff --git a/src/pages/cart/components/timeEstimate/TimeEstimateCard.tsx b/src/pages/cart/components/timeEstimate/TimeEstimateCard.tsx index a95705b..59f90e3 100644 --- a/src/pages/cart/components/timeEstimate/TimeEstimateCard.tsx +++ b/src/pages/cart/components/timeEstimate/TimeEstimateCard.tsx @@ -28,7 +28,13 @@ export default function TimeEstimateCard() { return ( <> - +