Skip to content

Commit cc0eff2

Browse files
authored
Update prompt.jsx
1 parent 5647336 commit cc0eff2

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/containers/prompt.jsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class Prompt extends React.Component {
3434
event.target.select();
3535
}
3636
handleOk () {
37-
this.props.onOk(this.state.inputValue, {
37+
if (this.props.isCustom) this.props.onOk();
38+
else this.props.onOk(this.state.inputValue, {
3839
scope: this.state.globalSelected ? 'global' : 'local',
3940
isCloud: this.state.cloudSelected
4041
});
@@ -58,7 +59,20 @@ class Prompt extends React.Component {
5859
}
5960
}
6061
render () {
61-
return (
62+
if (this.props.isCustom) return (
63+
<PromptComponent
64+
isCustom={this.props.isCustom}
65+
width={this.props.width}
66+
height={this.props.height}
67+
title={this.props.title}
68+
enterTitle={this.props.enterTitle}
69+
closeTitle={this.props.closeTitle}
70+
onOk={this.handleOk}
71+
onCancel={this.handleCancel}
72+
onKeyPress={this.handleKeyPress}
73+
/>
74+
)
75+
else return (
6276
<PromptComponent
6377
isAddingCloudVariableScratchSafe={this.state.isAddingCloudVariableScratchSafe}
6478
canAddCloudVariable={this.state.canAddCloudVariable}
@@ -93,7 +107,14 @@ Prompt.propTypes = {
93107
showCloudOption: PropTypes.bool.isRequired,
94108
showVariableOptions: PropTypes.bool.isRequired,
95109
title: PropTypes.string.isRequired,
96-
vm: PropTypes.instanceOf(VM)
110+
vm: PropTypes.instanceOf(VM),
111+
112+
/* custom modals */
113+
isCustom: PropTypes.bool,
114+
width: PropTypes.number,
115+
height: PropTypes.number,
116+
enterTitle: PropTypes.string,
117+
closeTitle: PropTypes.string
97118
};
98119

99120
export default Prompt;

0 commit comments

Comments
 (0)