diff --git a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx index c72ad8b028..e6184a7fe6 100644 --- a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +++ b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx @@ -6,19 +6,17 @@ import Card from "@components/Card"; import SliceMachineModal from "@components/SliceMachineModal"; type DeleteSliceZoneModalProps = { - isDeleteSliceZoneModalOpen: boolean; deleteSliceZone: () => void; closeDeleteSliceZoneModal: () => void; }; export const DeleteSliceZoneModal: FC = ({ - isDeleteSliceZoneModalOpen, deleteSliceZone, closeDeleteSliceZoneModal, }) => { return ( void; onSuccess: (slices: SharedSlice[]) => Promise; @@ -29,7 +28,6 @@ export type SliceZoneFormValues = { }; export const SlicesTemplatesModal: FC = ({ - isOpen, formId, close, onSuccess, @@ -40,8 +38,8 @@ export const SlicesTemplatesModal: FC = ({ return ( { diff --git a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx index 0a03bbab95..5181486529 100644 --- a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +++ b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx @@ -7,7 +7,6 @@ import ModalFormCard from "../../../../components/ModalFormCard"; import UpdateSliceZoneModalList from "./UpdateSliceZoneModalList"; interface UpdateSliceModalProps { - isOpen: boolean; formId: string; close: () => void; onSubmit: (slices: SharedSlice[]) => Promise; @@ -19,7 +18,6 @@ export type SliceZoneFormValues = { }; const UpdateSliceZoneModal: React.FC = ({ - isOpen, formId, close, onSubmit, @@ -27,8 +25,8 @@ const UpdateSliceZoneModal: React.FC = ({ }) => { return ( { diff --git a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/index.tsx b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/index.tsx index 8a15ba977f..aff7119311 100644 --- a/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +++ b/packages/slice-machine/lib/builders/CustomTypeBuilder/SliceZone/index.tsx @@ -296,56 +296,59 @@ const SliceZone: React.FC = ({ /> ) ) : undefined} - { - const newCustomType = await addSlicesToSliceZone({ - customType, - tabId, - slices, - }); - onAddSlicesToSliceZone(newCustomType); - closeUpdateSliceZoneModal(); - redirectToEditMode(); - toast.success("Slice(s) added to slice zone"); - }} - close={closeUpdateSliceZoneModal} - /> - { - const newCustomType = await addSlicesToSliceZone({ - customType, - tabId, - slices, - }); - onAddSlicesToSliceZone(newCustomType); - closeSlicesTemplatesModal(); - redirectToEditMode(); - toast.success( - - ); - }} - close={closeSlicesTemplatesModal} - /> - { - setIsDeleteSliceZoneModalOpen(false); - }} - deleteSliceZone={() => { - onDeleteSliceZone(); - setIsDeleteSliceZoneModalOpen(false); - }} - /> + {isUpdateSliceZoneModalOpen && ( + { + const newCustomType = await addSlicesToSliceZone({ + customType, + tabId, + slices, + }); + onAddSlicesToSliceZone(newCustomType); + closeUpdateSliceZoneModal(); + redirectToEditMode(); + toast.success("Slice(s) added to slice zone"); + }} + close={closeUpdateSliceZoneModal} + /> + )} + {isSlicesTemplatesModalOpen && ( + { + const newCustomType = await addSlicesToSliceZone({ + customType, + tabId, + slices, + }); + onAddSlicesToSliceZone(newCustomType); + closeSlicesTemplatesModal(); + redirectToEditMode(); + toast.success( + + ); + }} + close={closeSlicesTemplatesModal} + /> + )} + {isDeleteSliceZoneModalOpen && ( + { + setIsDeleteSliceZoneModalOpen(false); + }} + deleteSliceZone={() => { + onDeleteSliceZone(); + setIsDeleteSliceZoneModalOpen(false); + }} + /> + )} {localLibraries?.length !== 0 && isCreateSliceModalOpen && ( {