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

+ Any data tied to your Git project may become misconfigured. Are you sure + you want to continue? +

+
+ ); +}; diff --git a/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx b/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx index 594062fe..f0a35e97 100644 --- a/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx +++ b/packages/frontend/src/components/projects/project/settings/RepoConnectedSection.tsx @@ -2,8 +2,8 @@ import React, { useState } from 'react'; import { Button, Typography } from '@material-tailwind/react'; -import { GitRepositoryDetails } from '../../../../types'; -import ConfirmDialog from '../../../shared/ConfirmDialog'; +import { GitRepositoryDetails } from 'types'; +import { DisconnectRepositoryDialog } from 'components/projects/Dialog/DisconnectRepositoryDialog'; const RepoConnectedSection = ({ linkedRepo, @@ -34,21 +34,13 @@ const RepoConnectedSection = ({ ^ Disconnect - setDisconnectRepoDialogOpen((preVal) => !preVal)} + setDisconnectRepoDialogOpen((preVal) => !preVal)} open={disconnectRepoDialogOpen} - confirmButtonTitle="Yes, confirm disconnect" handleConfirm={() => { setDisconnectRepoDialogOpen((preVal) => !preVal); }} - color="red" - > - - Any data tied to your Git project may become misconfigured. Are you - sure you want to continue? - - + /> ); };