Skip to content

feat: have user type name of thing to delete for extra safety #4080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 20, 2022
Prev Previous commit
Next Next commit
Format
  • Loading branch information
presleyp committed Sep 14, 2022
commit 0dc271777930464a351338aab196ccf2e103894f
30 changes: 16 additions & 14 deletions site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TextField from "@material-ui/core/TextField"
import Typography from "@material-ui/core/Typography"
import { Maybe } from "components/Conditionals/Maybe"
import { Stack } from "components/Stack/Stack"
import React, { useState, ChangeEvent } from "react"
import React, { ChangeEvent, useState } from "react"
import { useTranslation } from "react-i18next"
import { ConfirmDialog } from "../ConfirmDialog/ConfirmDialog"

Expand Down Expand Up @@ -51,21 +51,23 @@ export const DeleteDialog: React.FC<React.PropsWithChildren<DeleteDialogProps>>
</>
)

return <ConfirmDialog
type="delete"
hideCancel={false}
open={isOpen}
title={title}
onConfirm={onConfirm}
onClose={onCancel}
description={content}
confirmLoading={confirmLoading}
disabled={!confirmed}
/>
return (
<ConfirmDialog
type="delete"
hideCancel={false}
open={isOpen}
title={title}
onConfirm={onConfirm}
onClose={onCancel}
description={content}
confirmLoading={confirmLoading}
disabled={!confirmed}
/>
)
}

const useStyles = makeStyles((theme) => ({
warning: {
color: theme.palette.warning.light
}
color: theme.palette.warning.light,
},
}))