From afcf36371f7f14917cc7ea2d678b05d139059fb6 Mon Sep 17 00:00:00 2001 From: Xavier Rutayisire Date: Mon, 29 Jan 2024 21:50:33 +0100 Subject: [PATCH] refactor(slices): Remove renameSliceSaga --- .../components/DeleteSliceModal/index.tsx | 16 +-- .../RenameSliceModal/RenameSliceModal.tsx | 57 ++++++---- packages/slice-machine/pages/slices.tsx | 20 ++-- packages/slice-machine/src/apiClient.ts | 17 +-- packages/slice-machine/src/domain/slice.ts | 10 ++ .../features/slices/actions/renameSlice.ts | 37 +++++++ .../src/modules/loading/types.ts | 1 - .../slice-machine/src/modules/modal/types.ts | 1 - .../slice-machine/src/modules/slices/index.ts | 104 ++---------------- .../src/modules/slices/selector.ts | 14 --- .../src/modules/useSliceMachineActions.ts | 33 +++--- packages/slice-machine/src/redux/saga.ts | 2 - 12 files changed, 128 insertions(+), 184 deletions(-) create mode 100644 packages/slice-machine/src/features/slices/actions/renameSlice.ts diff --git a/packages/slice-machine/components/DeleteSliceModal/index.tsx b/packages/slice-machine/components/DeleteSliceModal/index.tsx index eddf9289a6..e3cfe0e590 100644 --- a/packages/slice-machine/components/DeleteSliceModal/index.tsx +++ b/packages/slice-machine/components/DeleteSliceModal/index.tsx @@ -9,16 +9,16 @@ import { Button } from "@components/Button"; import { deleteSlice } from "@src/features/slices/actions/deleteSlice"; type DeleteSliceModalProps = { - isModalOpen: boolean; + isOpen: boolean; libName: string; sliceId: string; sliceName: string; - onCloseModal: () => void; + onClose: () => void; }; export const DeleteSliceModal: React.FunctionComponent< DeleteSliceModalProps -> = ({ sliceId, sliceName, libName, isModalOpen, onCloseModal }) => { +> = ({ sliceId, sliceName, libName, isOpen, onClose }) => { const [isDeleting, setIsDeleting] = useState(false); const { deleteSliceSuccess } = useSliceMachineActions(); const { theme } = useThemeUI(); @@ -35,20 +35,20 @@ export const DeleteSliceModal: React.FunctionComponent< }, }); - onCloseModal(); + onClose(); setIsDeleting(false); }; return ( - + )} Footer={() => ( @@ -104,7 +104,7 @@ export const DeleteSliceModal: React.FunctionComponent<