File tree Expand file tree Collapse file tree 2 files changed +294
-287
lines changed Expand file tree Collapse file tree 2 files changed +294
-287
lines changed Original file line number Diff line number Diff line change @@ -27,33 +27,40 @@ const useStyles = makeStyles()(theme => ({
27
27
top : theme . spacing ( 1 ) ,
28
28
color : theme . palette . grey [ 500 ] ,
29
29
} ,
30
+ errorBox : {
31
+ width : 800 ,
32
+ margin : 40 ,
33
+ } ,
30
34
} ) )
31
35
32
36
function DialogError ( { error } : { error : unknown } ) {
37
+ const { classes } = useStyles ( )
33
38
return (
34
- < div style = { { width : 800 , margin : 40 } } >
39
+ < div className = { classes . errorBox } >
35
40
< ErrorMessage error = { error } />
36
41
</ div >
37
42
)
38
43
}
39
44
40
45
interface Props extends DialogProps {
41
46
header ?: React . ReactNode
47
+ titleNode ?: React . ReactNode
42
48
}
43
49
44
50
const Dialog = observer ( function ( props : Props ) {
45
51
const { classes } = useStyles ( )
46
- const { title, header, children, onClose } = props
52
+ const { titleNode, ...rest } = props
53
+ const { title, header, children, onClose } = rest
47
54
const theme = useTheme ( )
48
55
49
56
return (
50
- < MUIDialog { ...props } >
57
+ < MUIDialog { ...rest } >
51
58
< ScopedCssBaseline >
52
59
{ isValidElement ( header ) ? (
53
60
header
54
61
) : (
55
62
< DialogTitle >
56
- < SanitizedHTML html = { title || '' } />
63
+ { titleNode || < SanitizedHTML html = { title || '' } /> }
57
64
{ onClose ? (
58
65
< IconButton
59
66
className = { classes . closeButton }
You can’t perform that action at this time.
0 commit comments