From 97289d85a3da163a62144a07062c0a06ab10d081 Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Thu, 14 Mar 2024 21:53:48 +0700 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20create=20cance?= =?UTF-8?q?l=20deployment=20dialog=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dialog/CancelDeploymentDialog.tsx | 30 +++++++++++++++++++ .../src/components/projects/create/Deploy.tsx | 20 ++++--------- 2 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 packages/frontend/src/components/projects/Dialog/CancelDeploymentDialog.tsx diff --git a/packages/frontend/src/components/projects/Dialog/CancelDeploymentDialog.tsx b/packages/frontend/src/components/projects/Dialog/CancelDeploymentDialog.tsx new file mode 100644 index 00000000..f238788d --- /dev/null +++ b/packages/frontend/src/components/projects/Dialog/CancelDeploymentDialog.tsx @@ -0,0 +1,30 @@ +import ConfirmDialog, { + ConfirmDialogProps, +} from 'components/shared/ConfirmDialog'; +import React from 'react'; + +interface CancelDeploymentDialogProps extends ConfirmDialogProps {} + +export const CancelDeploymentDialog = ({ + open, + handleCancel, + handleConfirm, + ...props +}: CancelDeploymentDialogProps) => { + return ( + +

+ This will halt the deployment and you'll have to start the process + from scratch. +

+
+ ); +}; diff --git a/packages/frontend/src/components/projects/create/Deploy.tsx b/packages/frontend/src/components/projects/create/Deploy.tsx index a251773d..f443d5ed 100644 --- a/packages/frontend/src/components/projects/create/Deploy.tsx +++ b/packages/frontend/src/components/projects/create/Deploy.tsx @@ -1,14 +1,12 @@ import React, { useCallback, useEffect } from 'react'; import { useNavigate, useParams, useSearchParams } from 'react-router-dom'; -import { Typography } from '@material-tailwind/react'; - import { DeployStep, DeployStatus } from './DeployStep'; -import { Stopwatch, setStopWatchOffset } from '../../StopWatch'; -import ConfirmDialog from 'components/shared/ConfirmDialog'; +import { Stopwatch, setStopWatchOffset } from 'components/StopWatch'; import { Heading } from 'components/shared/Heading'; import { Button } from 'components/shared/Button'; import { ClockOutlineIcon, WarningIcon } from 'components/shared/CustomIcon'; +import { CancelDeploymentDialog } from 'components/projects/Dialog/CancelDeploymentDialog'; const TIMEOUT_DURATION = 5000; const Deploy = () => { @@ -55,19 +53,11 @@ const Deploy = () => { > Cancel - - - This will halt the deployment and you will have to start the process - from scratch. - - + />