Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <FadeInView style={{ flex: 1 }}>
- <KeyboardAvoidingView
- style={s.container}
- contentContainerStyle={{alignItems: 'center'}}
- behavior="position"
- keyboardVerticalOffset={-80}
- >
- <View style={{
- width: 100, height: 100, borderWidth: 1,
- borderColor: '#E0E0E0', marginBottom: 30,
- }} />
- <Item>
- <Input
- placeholder={t('login:username')}
- onChangeText={(username) => { username = username.trim(); return this.setState({ username }); }} />
- </Item>
- <Item style={{ marginBottom: 10 }}>
- <Input
- secureTextEntry={true}
- placeholder={t('login:password')}
- onChangeText={(password) => { password = password.trim(); return this.setState({ password }); }} />
- </Item>
- {isFetching ?
- <TouchableOpacity
- disabled={true}
- style={cs.button}
- onPress={() => this.onLogin()}>
- <Text>{t('common:loading').toUpperCase()}</Text>
- </TouchableOpacity>
- :
- <TouchableOpacity
- activeOpacity={0.7}
- style={cs.button}
- onPress={() => this.onLogin()}>
- <Text style={cs.buttonText}>{t('login:login').toUpperCase()}</Text>
- </TouchableOpacity>
- }
- {errorMessage != null &&
- <Text style={cs.errorMessage}>{errorMessage}</Text>
- }
- </KeyboardAvoidingView>
- </FadeInView>
- const s = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#fff',
- alignItems: 'center',
- paddingTop: 50,
- paddingRight: 20,
- paddingLeft: 20,
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement