Skip to content

Commit

Permalink
Delete alert button text
Browse files Browse the repository at this point in the history
  • Loading branch information
RichGriff committed Jun 20, 2024
1 parent e3fae24 commit b12c9d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions next_frontend/components/cases/ActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const ActionButtons = ({ showCreateGoal, actions, notify, notifyError }: ActionB
onClose={() => setDeleteOpen(false)}
onConfirm={onDelete}
loading={loading}
confirmButtonText={'Delete'}
/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions next_frontend/components/cases/CaseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const CaseCard = ({ assuranceCase } : CaseCardProps) => {
onClose={() => setOpen(false)}
onConfirm={onDelete}
loading={loading}
confirmButtonText={'Delete'}
/>
</div>
)
Expand Down
2 changes: 2 additions & 0 deletions next_frontend/components/common/NodeEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ const NodeEdit = ({ node, isOpen, setEditOpen }: NodeEditProps) => {
onClose={() => setDeleteOpen(false)}
onConfirm={handleDelete}
loading={loading}
confirmButtonText={'Delete'}
/>

<AlertModal
Expand All @@ -280,6 +281,7 @@ const NodeEdit = ({ node, isOpen, setEditOpen }: NodeEditProps) => {
onConfirm={handleClose}
loading={loading}
message={'There are unresolved changes, continue to discard these changes.'}
confirmButtonText={'Discard Changes'}
/>
</>
)}
Expand Down
6 changes: 4 additions & 2 deletions next_frontend/components/modals/alertModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ interface AlertModalProps {
onConfirm: () => void;
loading: boolean;
message?: string
confirmButtonText: string
}

export const AlertModal: React.FC<AlertModalProps> = ({
isOpen,
onClose,
onConfirm,
loading,
message
message,
confirmButtonText
}) => {
const [isMounted, setIsMounted] = useState(false);

Expand All @@ -42,7 +44,7 @@ export const AlertModal: React.FC<AlertModalProps> = ({
Cancel
</Button>
<Button disabled={loading} variant="destructive" onClick={onConfirm}>
{loading ? 'Deleting' : 'Continue'}
{loading ? 'Deleting' : confirmButtonText}
</Button>
</div>
</Modal>
Expand Down

0 comments on commit b12c9d2

Please sign in to comment.