Fix autoshow of modal

This commit is contained in:
Jake Howard 2016-02-03 19:01:23 +00:00
parent f648c9d093
commit 97528e62c7

View file

@ -61,7 +61,8 @@ const styles = StyleSheet.create({
}, },
helpText: { helpText: {
fontSize: 11, fontSize: 11,
fontStyle: 'italic' fontStyle: 'italic',
padding: 5,
}, },
text: { text: {
color: 'white' color: 'white'
@ -76,15 +77,13 @@ export default class Login extends React.Component {
showTokenHelp: false showTokenHelp: false
}; };
this.validate = this.validate.bind(this); this.validate = this.validate.bind(this);
this.updateState = this.updateState.bind(this); this.textChanged = this.textChanged.bind(this);
this.showTokenHelp = this.showTokenHelp.bind(this); this.showTokenHelp = this.showTokenHelp.bind(this);
this.hideTokenHelp = this.hideTokenHelp.bind(this); this.hideTokenHelp = this.hideTokenHelp.bind(this);
} }
updateState(key, value) { textChanged(token) {
let state = this.state; this.setState({ token });
state[key] = value;
this.setState(state);
} }
validate() { validate() {
@ -127,7 +126,7 @@ export default class Login extends React.Component {
</Text> </Text>
<TextInput <TextInput
style={[styles.input, styles.text]} style={[styles.input, styles.text]}
onChangeText={(token) => this.updateState('token', token)} onChangeText={this.textChanged}
value={this.state.token} value={this.state.token}
onSubmitEditing={this.validate} onSubmitEditing={this.validate}
placeholder="CircleCI Token" placeholder="CircleCI Token"