From c51b50428f32608bc46438e9d7964429b2d595da Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Sun, 6 Nov 2022 01:14:58 +0500 Subject: [PATCH] fix(web): use mui treeView instead of custom implementation --- .../components/deleteConfirmationModal.tsx | 16 ++- web/src/components/nameInputModal.tsx | 16 ++- web/src/components/tree.tsx | 136 ++++++++---------- web/src/containers/Studio/sideBar.tsx | 1 - 4 files changed, 85 insertions(+), 84 deletions(-) diff --git a/web/src/components/deleteConfirmationModal.tsx b/web/src/components/deleteConfirmationModal.tsx index ec0eb0ba..cae63342 100644 --- a/web/src/components/deleteConfirmationModal.tsx +++ b/web/src/components/deleteConfirmationModal.tsx @@ -31,14 +31,24 @@ const DeleteConfirmationModal = ({ message, _delete }: DeleteConfirmationModalProps) => { + const handleDeleteClick = (event: React.MouseEvent) => { + event.stopPropagation() + _delete() + } + + const handleClose = (event: any) => { + event.stopPropagation() + setOpen(false) + } + return ( - setOpen(false)} open={open}> + {message} - - + diff --git a/web/src/components/nameInputModal.tsx b/web/src/components/nameInputModal.tsx index a3bff3a4..3a81fab8 100644 --- a/web/src/components/nameInputModal.tsx +++ b/web/src/components/nameInputModal.tsx @@ -69,8 +69,18 @@ const NameInputModal = ({ action(name) } + const handleActionClick = (event: React.MouseEvent) => { + event.stopPropagation() + action(name) + } + + const handleClose = (event: any) => { + event.stopPropagation() + setOpen(false) + } + return ( - setOpen(false)} open={open}> + {title} @@ -91,12 +101,12 @@ const NameInputModal = ({ -