@@ -15,6 +15,7 @@ export const SimpleTwoActionsDialog = ({
15
15
button1Props,
16
16
button2Props,
17
17
closeOnBackdropClick,
18
+ component,
18
19
} ) => {
19
20
const onClose = ( event , reason ) => {
20
21
if ( closeOnBackdropClick || reason !== 'backdropClick' ) {
@@ -33,7 +34,9 @@ export const SimpleTwoActionsDialog = ({
33
34
>
34
35
< DialogTitle id = { id + '-dialog-title' } > { labels . title } </ DialogTitle >
35
36
< DialogContent >
36
- < Typography variant = "body1" > { labels . body } </ Typography >
37
+ < Typography variant = "body1" component = { component } >
38
+ { labels . body }
39
+ </ Typography >
37
40
</ DialogContent >
38
41
< DialogActions >
39
42
< Button
@@ -84,7 +87,7 @@ SimpleTwoActionsDialog.propTypes = {
84
87
*/
85
88
labels : PropTypes . shape ( {
86
89
title : PropTypes . string . isRequired ,
87
- body : PropTypes . string . isRequired ,
90
+ body : PropTypes . node . isRequired ,
88
91
button1 : PropTypes . string . isRequired ,
89
92
button2 : PropTypes . string . isRequired ,
90
93
} ) ,
@@ -117,6 +120,10 @@ SimpleTwoActionsDialog.propTypes = {
117
120
* Close dialog on backdrop click
118
121
*/
119
122
closeOnBackdropClick : PropTypes . bool ,
123
+ /**
124
+ * HTML tag to be rendered as dialog's body, e.g., 'div', 'span', 'p' (default value)
125
+ */
126
+ component : PropTypes . string ,
120
127
} ;
121
128
122
129
SimpleTwoActionsDialog . defaultProps = {
@@ -139,4 +146,5 @@ SimpleTwoActionsDialog.defaultProps = {
139
146
button1Props : { } ,
140
147
button2Props : { } ,
141
148
closeOnBackdropClick : false ,
149
+ component : 'p' ,
142
150
} ;
0 commit comments