Rename submitAction to onSubmit

pull/4233/head
Deniz Kusefoglu 2018-08-16 09:11:01 -07:00
parent b5eba4d92b
commit bb942455f0
2 changed files with 5 additions and 6 deletions

View File

@ -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)

View File

@ -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}