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

View File

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