@@ -40,7 +40,41 @@ const messages = defineMessages({
40
40
}
41
41
} ) ;
42
42
43
- const PromptComponent = props => (
43
+ const PromptComponent = props => props . isCustom ? (
44
+ < Modal
45
+ className = { styles . modalContent }
46
+ contentLabel = { props . title }
47
+ id = "customModal"
48
+ onRequestClose = { props . onCancel }
49
+ >
50
+ < Box className = { styles . body } >
51
+ < Box >
52
+ </ Box >
53
+ < Box className = { styles . buttonRow } >
54
+ < button
55
+ className = { styles . cancelButton }
56
+ onClick = { props . onCancel }
57
+ >
58
+ < FormattedMessage
59
+ defaultMessage = { props . closeTitle }
60
+ description = "Button in prompt for cancelling the dialog"
61
+ id = "gui.prompt.cancel"
62
+ />
63
+ </ button >
64
+ < button
65
+ className = { styles . okButton }
66
+ onClick = { props . onOk }
67
+ >
68
+ < FormattedMessage
69
+ defaultMessage = { props . enterTitle }
70
+ description = "Button in prompt for confirming the dialog"
71
+ id = "gui.prompt.ok"
72
+ />
73
+ </ button >
74
+ </ Box >
75
+ </ Box >
76
+ </ Modal >
77
+ ) : (
44
78
< Modal
45
79
className = { styles . modalContent }
46
80
contentLabel = { props . title }
@@ -188,24 +222,29 @@ const PromptComponent = props => (
188
222
) ;
189
223
190
224
PromptComponent . propTypes = {
191
- isAddingCloudVariableScratchSafe : PropTypes . bool . isRequired ,
192
- canAddCloudVariable : PropTypes . bool . isRequired ,
193
- cloudSelected : PropTypes . bool . isRequired ,
194
- defaultValue : PropTypes . string ,
195
- globalSelected : PropTypes . bool . isRequired ,
196
- isStage : PropTypes . bool . isRequired ,
197
- showListMessage : PropTypes . bool . isRequired ,
198
- label : PropTypes . string . isRequired ,
225
+ title : PropTypes . string . isRequired ,
199
226
onCancel : PropTypes . func . isRequired ,
200
- onChange : PropTypes . func . isRequired ,
201
- onCloudVarOptionChange : PropTypes . func ,
202
- onFocus : PropTypes . func . isRequired ,
203
227
onKeyPress : PropTypes . func . isRequired ,
204
228
onOk : PropTypes . func . isRequired ,
205
- onScopeOptionSelection : PropTypes . func . isRequired ,
206
- showCloudOption : PropTypes . bool . isRequired ,
207
- showVariableOptions : PropTypes . bool . isRequired ,
208
- title : PropTypes . string . isRequired
229
+ isAddingCloudVariableScratchSafe : PropTypes . bool ,
230
+ canAddCloudVariable : PropTypes . bool ,
231
+ cloudSelected : PropTypes . bool ,
232
+ defaultValue : PropTypes . string ,
233
+ globalSelected : PropTypes . bool ,
234
+ isStage : PropTypes . bool ,
235
+ showListMessage : PropTypes . bool ,
236
+ label : PropTypes . string ,
237
+ onChange : PropTypes . func ,
238
+ onCloudVarOptionChange : PropTypes . func ,
239
+ onFocus : PropTypes . func ,
240
+ onScopeOptionSelection : PropTypes . func ,
241
+ showCloudOption : PropTypes . bool ,
242
+ showVariableOptions : PropTypes . bool ,
243
+
244
+ /* custom modals */
245
+ isCustom : PropTypes . bool ,
246
+ enterTitle : PropTypes . string ,
247
+ closeTitle : PropTypes . string
209
248
} ;
210
249
211
250
export default PromptComponent ;
0 commit comments