mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-03 04:11:55 -05:00
Add Delete Account functionality (#363)
* feat: add deletes account button on profile section. * feat: add delete account action when user click on delete account button * feat:logout user when his account is deleted * feat: added warning message before user deletes account * feat: add description to Delete account section * fix: fix: build issue. * fix: avoid giving the ownership of a team to a member who is not an admin * fix: merge conflict * fix: use !== in delete button disabled prop * fix: typo semething -> Something * refactor: simplified user deletion logic * refactor: explain user deletion logic * refactor: remove unecessary delete membership queries * feat: add deletes account button on profile section. * feat: add delete account action when user click on delete account button * feat:logout user when his account is deleted * feat: added warning message before user deletes account * fix merge conlicts * update to delete info text * feat: delete the team if the owner deletes his account and the team has no admins * add await
This commit is contained in:
@@ -12,6 +12,8 @@ interface DeleteDialogProps {
|
||||
isDeleting?: boolean;
|
||||
useSaveInsteadOfCancel?: boolean;
|
||||
onSave?: () => void;
|
||||
children?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export default function DeleteDialog({
|
||||
@@ -23,10 +25,13 @@ export default function DeleteDialog({
|
||||
isDeleting,
|
||||
useSaveInsteadOfCancel = false,
|
||||
onSave,
|
||||
children,
|
||||
disabled,
|
||||
}: DeleteDialogProps) {
|
||||
return (
|
||||
<Modal open={open} setOpen={setOpen} title={`Delete ${deleteWhat}`}>
|
||||
<p>{text || "Are you sure? This action cannot be undone."}</p>
|
||||
<div>{children}</div>
|
||||
<div className="my-4 space-x-2 text-right">
|
||||
<Button
|
||||
variant="secondary"
|
||||
@@ -38,7 +43,7 @@ export default function DeleteDialog({
|
||||
}}>
|
||||
{useSaveInsteadOfCancel ? "Save" : "Cancel"}
|
||||
</Button>
|
||||
<Button variant="warn" onClick={onDelete} loading={isDeleting}>
|
||||
<Button variant="warn" onClick={onDelete} loading={isDeleting} disabled={disabled}>
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user