hide unnecessary elements

This commit is contained in:
2026-01-14 21:59:02 +03:00
parent ce68b8b978
commit a68480c075
7 changed files with 72 additions and 32 deletions

View File

@@ -7,6 +7,8 @@ import CarRatioGroups from "./CarRatioGroups/CarRatioGroups";
import PlusIcon from "components/Icons/PlusIcon";
import styles from "../checkout.module.css";
import { AddCarBottomSheet } from "components/CustomBottomSheet/AddCarBottomSheet";
import { updatePlateCar } from "features/order/orderSlice";
import { useAppDispatch } from "redux/hooks";
interface CarBottomSheetProps {
isOpen: boolean;
@@ -17,6 +19,7 @@ export function CarBottomSheet({ isOpen, onClose }: CarBottomSheetProps) {
const { t } = useTranslation();
const [value, setValue] = useState<string | null>(null);
const [isAddCarOpen, setIsAddCarOpen] = useState(false);
const dispatch = useAppDispatch();
const handleCancel = () => {
setValue(null);
@@ -24,8 +27,8 @@ export function CarBottomSheet({ isOpen, onClose }: CarBottomSheetProps) {
};
const handleSave = () => {
dispatch(updatePlateCar(value || ""));
onClose();
setValue(value);
};
const handleAddCarClick = () => {
@@ -38,9 +41,8 @@ export function CarBottomSheet({ isOpen, onClose }: CarBottomSheetProps) {
// The parent component should handle reopening, but we'll ensure state is correct
};
const handleAddCarSave = (carDetails: any) => {
// Handle saving the new car details
console.log("Car details saved:", carDetails);
const handleAddCarSave = () => {
dispatch(updatePlateCar(value || ""));
// After saving, close AddCarBottomSheet which will trigger reopening CarBottomSheet
setIsAddCarOpen(false);
};