import React from 'react-native'; import GlobalStyles from '../../settings/styles'; const { StyleSheet, Text, View, TextInput, TouchableHighlight, ScrollView, BackAndroid } = React; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F5FCFF', }, contentWrapper: { flex: 0.85, justifyContent: 'flex-start', alignItems: 'center' }, input: { marginHorizontal: 15, fontSize: 15, textAlign: 'center' }, loginButton: { flex: 1, backgroundColor: GlobalStyles.get('CIRCLE_BLUE'), justifyContent: 'center', alignItems: 'center', padding: 10 }, loginButtonText: { fontSize: 18, color: 'white', }, buttonContainer: { flexDirection: 'row', justifyContent: 'center', padding: 10, paddingVertical: 15 }, title: { fontSize: 30, margin: 13 }, heading: { fontSize: 18, margin: 8, marginVertical: 20 }, helpText: { fontSize: 12, } }); export default class Login extends React.Component { constructor() { super(); this.state = { token: '' }; this.validate = this.validate.bind(this); this.updateState = this.updateState.bind(this); } updateState(key, value) { let state = this.state; state[key] = value; this.setState(state); } validate() { } componentWillUnmount() { BackAndroid.removeEventListener('hardwareBackPress', () => { return true; }); // Re-enable back button } componentWillMount() { BackAndroid.addEventListener('hardwareBackPress', () => { return true; }); // Disable back button } render() { return ( Sphere Please enter your CircleCI token this.updateState('token', token)} value={this.state.token} onSubmitEditing={this.validate} placeholder="CircleCI Token" autoCorrect={false} /> What's this? Authenticate ); } };