Skip to content
Snippets Groups Projects

CE-3633: Migrate dialogs

Merged Johanna Szepanski requested to merge CE-3633-migrate-dialogs into main
2 files
+ 9
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -73,7+73,7 @@
@@ -73,7+73,7 @@
* @param {renderActionsCallback} renderActions - render function that receives the onClose callback and returns the dialog footer/actions
* @param {renderActionsCallback} renderActions - render function that receives the onClose callback and returns the dialog footer/actions
* @param {boolean} open return true or false
* @param {boolean} open return true or false
* @param {function} onClose callback fired when the component requests to be closed
* @param {function} onClose callback fired when the component requests to be closed
* @param {object} DialogProps MUI Dialog component props; this might be how you change the
* @param {object} DialogProps MUI Dialog component props; this might be how you change the
* width of the modal via fullWidth=true, maxWidth="md", for example. See MUI documentation.
* width of the modal via fullWidth=true, maxWidth="md", for example. See MUI documentation.
* @param {string} className containing css classname
* @param {string} className containing css classname
*/
*/
@@ -81,7+81,7 @@
@@ -81,7+81,7 @@
interface DialogProps {
interface DialogProps {
title: string | ReactNode;
title: string | ReactNode;
content: string | ReactNode;
content: string | ReactNode;
open: boolean;
DialogProps: DialogPropsMUI;
DialogProps?: DialogPropsMUI;
className?: string;
className?: string;
isLoading?: boolean;
isLoading?: boolean;
error?: string;
error?: string;
@@ -93,7 +92,6 @@ interface DialogProps {
@@ -93,7 +92,6 @@ interface DialogProps {
export const Dialog = ({
export const Dialog = ({
title,
title,
content,
content,
open,
className,
className,
isLoading,
isLoading,
error,
error,
@@ -103,7 +101,6 @@ export const Dialog = ({
@@ -103,7 +101,6 @@ export const Dialog = ({
}: DialogProps) => {
}: DialogProps) => {
return (
return (
<MuiDialog
<MuiDialog
open={open}
onClose={onClose}
onClose={onClose}
fullWidth
fullWidth
maxWidth="sm"
maxWidth="sm"
@@ -220,18 +217,18 @@ export const ConfirmationDialog = styled(
@@ -220,18 +217,18 @@ export const ConfirmationDialog = styled(
({
({
title,
title,
content,
content,
open,
onConfirm,
onConfirm,
onClose,
onClose,
confirmText = "Yes",
confirmText = "Yes",
cancelText = "No",
cancelText = "No",
isConfirmDisabled = false
isConfirmDisabled = false,
 
DialogProps
}: ConfirmationDialogProps) => {
}: ConfirmationDialogProps) => {
return (
return (
<Dialog
<Dialog
title={title}
title={title}
content={content}
content={content}
open={open}
DialogProps={DialogProps}
onClose={onClose}
onClose={onClose}
renderActions={() => (
renderActions={() => (
<ConfirmationDialogButtons
<ConfirmationDialogButtons
@@ -256,7 +253,7 @@ export const ConfirmDangerActionDialog = ({
@@ -256,7 +253,7 @@ export const ConfirmDangerActionDialog = ({
content,
content,
confirmText,
confirmText,
valueToCheck,
valueToCheck,
open,
DialogProps,
onClose,
onClose,
onConfirm,
onConfirm,
isLoading,
isLoading,
@@ -280,6 +277,7 @@ export const ConfirmDangerActionDialog = ({
@@ -280,6 +277,7 @@ export const ConfirmDangerActionDialog = ({
confirmText={confirmText}
confirmText={confirmText}
cancelText="Cancel"
cancelText="Cancel"
onClose={handleClose}
onClose={handleClose}
 
DialogProps={DialogProps}
content={
content={
<Grid
<Grid
container
container
Loading