Skip to content

Commit dedd5f5

Browse files
committed
frontend: ConfirmDialog: Add update to confirm dialog story
Signed-off-by: Vincent T <[email protected]>
1 parent 7021f48 commit dedd5f5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

frontend/src/components/common/ConfirmDialog.stories.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,19 @@ ConfirmDialogClosed.args = {
2626
title: 'A fine title',
2727
description: 'A really good description.',
2828
};
29+
30+
export const ConfirmDialogWithCheckbox = Template.bind({});
31+
ConfirmDialogWithCheckbox.args = {
32+
open: true,
33+
title: 'A fine title',
34+
description: 'A really good description, only now we are using a checkbox.',
35+
checkboxDescription: 'Click the checkbox.',
36+
};
37+
38+
export const ConfirmDialogWithCheckboxClosed = Template.bind({});
39+
ConfirmDialogWithCheckboxClosed.args = {
40+
open: false,
41+
title: 'A fine title',
42+
description: 'A really good description, only now we are using a checkbox.',
43+
checkboxDescription: 'Click the checkbox.',
44+
};

frontend/src/components/common/ConfirmDialog.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ import { useTranslation } from 'react-i18next';
1010
import { DialogTitle } from './Dialog';
1111

1212
export interface ConfirmDialogProps extends MuiDialogProps {
13+
/**
14+
* Title of the dialog box
15+
*/
1316
title: string;
17+
/**
18+
* Description of the dialog box
19+
*/
1420
description: string | React.ReactNode;
21+
/*
22+
* Description of the checkbox
23+
* Note: If this is provided, an additional description will be rendered under the original and will require the checkbox to continue action.
24+
*/
1525
checkboxDescription?: string;
1626
onConfirm: () => void;
1727
handleClose: () => void;

0 commit comments

Comments
 (0)