diff --git a/packages/frontend/src/components/projects/Dialog/DeleteDomainDialog.tsx b/packages/frontend/src/components/projects/Dialog/DeleteDomainDialog.tsx new file mode 100644 index 00000000..5d6d3e07 --- /dev/null +++ b/packages/frontend/src/components/projects/Dialog/DeleteDomainDialog.tsx @@ -0,0 +1,42 @@ +import ConfirmDialog, { + ConfirmDialogProps, +} from 'components/shared/ConfirmDialog'; +import React from 'react'; + +interface DeleteDomainDialogProps extends ConfirmDialogProps { + projectName: string; + domainName: string; +} + +export const DeleteDomainDialog = ({ + projectName, + domainName, + open, + handleCancel, + handleConfirm, + ...props +}: DeleteDomainDialogProps) => { + return ( + +

+ Once deleted, the project{' '} + + {projectName} + {' '} + will not be accessible from the domain{' '} + + {domainName} + + . +

+
+ ); +}; diff --git a/packages/frontend/src/components/projects/project/settings/DomainCard.tsx b/packages/frontend/src/components/projects/project/settings/DomainCard.tsx index c5f657eb..e8a7c81c 100644 --- a/packages/frontend/src/components/projects/project/settings/DomainCard.tsx +++ b/packages/frontend/src/components/projects/project/settings/DomainCard.tsx @@ -12,9 +12,9 @@ import { Card, } from '@material-tailwind/react'; -import ConfirmDialog from '../../../shared/ConfirmDialog'; import EditDomainDialog from './EditDomainDialog'; -import { useGQLClient } from '../../../../context/GQLClientContext'; +import { useGQLClient } from 'context/GQLClientContext'; +import { DeleteDomainDialog } from 'components/projects/Dialog/DeleteDomainDialog'; enum RefreshStatus { IDLE, @@ -118,28 +118,16 @@ const DomainCard = ({ - setDeleteDialogOpen((preVal) => !preVal)} + setDeleteDialogOpen((preVal) => !preVal)} open={deleteDialogOpen} - confirmButtonTitle="Yes, Delete domain" handleConfirm={() => { deleteDomain(); setDeleteDialogOpen((preVal) => !preVal); }} - color="red" - > - - Once deleted, the project{' '} - - {project.name} - {' '} - will not be accessible from the domain{' '} - - {domain.name}. - - - + projectName={project.name} + domainName={domain.name} + />