mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
Addresses #23139 and #23141 - Remove a premature `return` that prevented subsequent `renderFlash` from firing - Fix order of `push` and subsequent `renderFlash` for correct behavior - Check codebase for additional instances of problematic `push` calls _after_ associated `renderFlash` calls via regex `\renderFlash\([\s\S\n]{0,400}router\.push/` - Misc cleanup  - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import React from "react";
|
|
|
|
import Modal from "components/Modal";
|
|
import Button from "components/buttons/Button";
|
|
|
|
const baseClass = "delete-team-modal";
|
|
|
|
interface IDeleteTeamModalProps {
|
|
name: string;
|
|
isUpdatingTeams: boolean;
|
|
onSubmit: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
const DeleteTeamModal = ({
|
|
name,
|
|
isUpdatingTeams,
|
|
onSubmit,
|
|
onCancel,
|
|
}: IDeleteTeamModalProps): JSX.Element => {
|
|
return (
|
|
<Modal
|
|
title="Delete team"
|
|
onExit={onCancel}
|
|
onEnter={onSubmit}
|
|
className={baseClass}
|
|
>
|
|
<>
|
|
<p>
|
|
You are about to delete{" "}
|
|
<span className={`${baseClass}__name`}>{name}</span> from Fleet.
|
|
</p>
|
|
<p>
|
|
Users on this team who are not assigned to other teams will lose
|
|
access to Fleet.
|
|
</p>
|
|
<p className={`${baseClass}__warning`}>This action cannot be undone.</p>
|
|
<div className="modal-cta-wrap">
|
|
<Button
|
|
type="button"
|
|
onClick={onSubmit}
|
|
variant="alert"
|
|
className="delete-loading"
|
|
isLoading={isUpdatingTeams}
|
|
>
|
|
Delete
|
|
</Button>
|
|
<Button onClick={onCancel} variant="inverse-alert">
|
|
Cancel
|
|
</Button>
|
|
</div>
|
|
</>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default DeleteTeamModal;
|