Rename submitAction to onSubmit
parent
b5eba4d92b
commit
bb942455f0
|
@ -13,7 +13,7 @@ interface Props {
|
||||||
isDisabled?: boolean
|
isDisabled?: boolean
|
||||||
onChange: (value: string) => void
|
onChange: (value: string) => void
|
||||||
valueModifier?: (value: string) => string
|
valueModifier?: (value: string) => string
|
||||||
submitAction?: (value: string) => void
|
onSubmit?: (value: string) => void
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
autoFocus?: boolean
|
autoFocus?: boolean
|
||||||
type?: string
|
type?: string
|
||||||
|
@ -35,7 +35,7 @@ class WizardTextInput extends PureComponent<Props, State> {
|
||||||
valueModifier: x => x,
|
valueModifier: x => x,
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
submitAction: x => null,
|
onSubmit: () => null,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -55,7 +55,6 @@ class WizardTextInput extends PureComponent<Props, State> {
|
||||||
autoFocus,
|
autoFocus,
|
||||||
label,
|
label,
|
||||||
type,
|
type,
|
||||||
submitAction,
|
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
let inputClass = ''
|
let inputClass = ''
|
||||||
|
@ -108,9 +107,9 @@ class WizardTextInput extends PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private submit = incomingValue => {
|
private submit = incomingValue => {
|
||||||
const {onChange, value, valueModifier, submitAction} = this.props
|
const {onChange, value, valueModifier, onSubmit} = this.props
|
||||||
const newValue = valueModifier(incomingValue)
|
const newValue = valueModifier(incomingValue)
|
||||||
submitAction(newValue)
|
onSubmit(newValue)
|
||||||
|
|
||||||
if (value !== newValue) {
|
if (value !== newValue) {
|
||||||
onChange(newValue)
|
onChange(newValue)
|
||||||
|
|
|
@ -107,7 +107,7 @@ class SourceStep extends PureComponent<Props, State> {
|
||||||
label="Connection URL"
|
label="Connection URL"
|
||||||
onChange={this.onChangeInput('url')}
|
onChange={this.onChangeInput('url')}
|
||||||
valueModifier={this.URLModifier}
|
valueModifier={this.URLModifier}
|
||||||
submitAction={this.syncHostnames}
|
onSubmit={this.syncHostnames}
|
||||||
/>
|
/>
|
||||||
<WizardTextInput
|
<WizardTextInput
|
||||||
value={source.name}
|
value={source.name}
|
||||||
|
|
Loading…
Reference in New Issue