Skip to content

Commit dc3cfc6

Browse files
authored
Update prompt.jsx
1 parent 27090fb commit dc3cfc6

File tree

1 file changed

+55
-16
lines changed

1 file changed

+55
-16
lines changed

src/components/prompt/prompt.jsx

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,41 @@ const messages = defineMessages({
4040
}
4141
});
4242

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+
) : (
4478
<Modal
4579
className={styles.modalContent}
4680
contentLabel={props.title}
@@ -188,24 +222,29 @@ const PromptComponent = props => (
188222
);
189223

190224
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,
199226
onCancel: PropTypes.func.isRequired,
200-
onChange: PropTypes.func.isRequired,
201-
onCloudVarOptionChange: PropTypes.func,
202-
onFocus: PropTypes.func.isRequired,
203227
onKeyPress: PropTypes.func.isRequired,
204228
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
209248
};
210249

211250
export default PromptComponent;

0 commit comments

Comments
 (0)