From 3cf2172520eb1db5f47c24eac1f89b6adf6f72d7 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 31 Mar 2023 00:25:42 +0530 Subject: [PATCH] style: delete workspace modal (#631) --- .../workspace/delete-workspace-modal.tsx | 129 +++++++++--------- 1 file changed, 66 insertions(+), 63 deletions(-) diff --git a/apps/app/components/workspace/delete-workspace-modal.tsx b/apps/app/components/workspace/delete-workspace-modal.tsx index dc96ee570..19189abc9 100644 --- a/apps/app/components/workspace/delete-workspace-modal.tsx +++ b/apps/app/components/workspace/delete-workspace-modal.tsx @@ -27,8 +27,10 @@ type Props = { export const DeleteWorkspaceModal: React.FC = ({ isOpen, data, onClose }) => { const [isDeleteLoading, setIsDeleteLoading] = useState(false); - const [confirmProjectName, setConfirmProjectName] = useState(""); - const [confirmDeleteMyProject, setConfirmDeleteMyProject] = useState(false); + + const [confirmWorkspaceName, setConfirmWorkspaceName] = useState(""); + const [confirmDeleteMyWorkspace, setConfirmDeleteMyWorkspace] = useState(false); + const [selectedWorkspace, setSelectedWorkspace] = useState(null); const router = useRouter(); @@ -44,7 +46,7 @@ export const DeleteWorkspaceModal: React.FC = ({ isOpen, data, onClose }) } }, [data]); - const canDelete = confirmProjectName === data?.name && confirmDeleteMyProject; + const canDelete = confirmWorkspaceName === data?.name && confirmDeleteMyWorkspace; const handleClose = () => { onClose(); @@ -100,71 +102,72 @@ export const DeleteWorkspaceModal: React.FC = ({ isOpen, data, onClose }) leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - -
-
-
+ +
+
+
-
- - Delete Workspace - -
-

- Are you sure you want to delete workspace- {" "} - {data?.name} - ? All of the data related to the workspace will be permanently - removed. This action cannot be undone. -

-
-
-

- Enter the workspace name{" "} - {selectedWorkspace?.name} to - continue: -

- { - setConfirmProjectName(e.target.value); - }} - name="workspaceName" - /> -
-
-

- To confirm, type{" "} - delete my workspace below: -

- { - if (e.target.value === "delete my workspace") { - setConfirmDeleteMyProject(true); - } else { - setConfirmDeleteMyProject(false); - } - }} - name="typeDelete" - /> -
-
+ + +

Delete Workspace

+
+
+ + +

+ Are you sure you want to delete workspace{" "} + {data?.name}? All of the data + related to the workspace will be permanently removed. This action cannot be + undone. +

+
+ +
+

+ Enter the workspace name{" "} + {selectedWorkspace?.name} to continue: +

+ { + setConfirmWorkspaceName(e.target.value); + }} + name="workspaceName" + /> +
+ +
+

+ To confirm, type delete my workspace{" "} + below: +

+ { + if (e.target.value === "delete my workspace") { + setConfirmDeleteMyWorkspace(true); + } else { + setConfirmDeleteMyWorkspace(false); + } + }} + name="typeDelete" + /> +
+ +
+ Cancel + + {isDeleteLoading ? "Deleting..." : "Delete Workspace"} +
-
-
- Cancel - - {isDeleteLoading ? "Deleting..." : "Delete"} -