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