Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <FadeInView style={{ flex: 1 }}>
  2. <KeyboardAvoidingView
  3. style={s.container}
  4. contentContainerStyle={{alignItems: 'center'}}
  5. behavior="position"
  6. keyboardVerticalOffset={-80}
  7. >
  8. <View style={{
  9. width: 100, height: 100, borderWidth: 1,
  10. borderColor: '#E0E0E0', marginBottom: 30,
  11. }} />
  12. <Item>
  13. <Input
  14. placeholder={t('login:username')}
  15. onChangeText={(username) => { username = username.trim(); return this.setState({ username }); }} />
  16. </Item>
  17. <Item style={{ marginBottom: 10 }}>
  18. <Input
  19. secureTextEntry={true}
  20. placeholder={t('login:password')}
  21. onChangeText={(password) => { password = password.trim(); return this.setState({ password }); }} />
  22. </Item>
  23. {isFetching ?
  24. <TouchableOpacity
  25. disabled={true}
  26. style={cs.button}
  27. onPress={() => this.onLogin()}>
  28. <Text>{t('common:loading').toUpperCase()}</Text>
  29. </TouchableOpacity>
  30. :
  31. <TouchableOpacity
  32. activeOpacity={0.7}
  33. style={cs.button}
  34. onPress={() => this.onLogin()}>
  35. <Text style={cs.buttonText}>{t('login:login').toUpperCase()}</Text>
  36. </TouchableOpacity>
  37. }
  38. {errorMessage != null &&
  39. <Text style={cs.errorMessage}>{errorMessage}</Text>
  40. }
  41. </KeyboardAvoidingView>
  42. </FadeInView>
  43.  
  44. const s = StyleSheet.create({
  45. container: {
  46. flex: 1,
  47. backgroundColor: '#fff',
  48. alignItems: 'center',
  49. paddingTop: 50,
  50. paddingRight: 20,
  51. paddingLeft: 20,
  52. },
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement