Advertisement
Guest User

Untitled

a guest
Dec 5th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. import React from 'react'
  2. import { TouchableOpacity, StyleSheet, Text, View, Button, TextInput, ScrollView, ImageBackground, Image } from 'react-native'
  3.  
  4. export default class LoginScreen extends React.Component {
  5.  
  6. constructor(props)
  7. {
  8. super(props);
  9. this.state = {
  10. isLoading: true,
  11. TextInputUser: '',
  12. TextInputPassword: '',
  13. TextInputServer: ''
  14. };
  15. }
  16.  
  17.  
  18. render() {
  19. return (
  20. <ImageBackground
  21. source={require('./img/background_5.png')}
  22. style={styles.contentContainer}>
  23.  
  24. <Text
  25. style={styles.title}>
  26. MR-Application
  27. </Text>
  28.  
  29. <Text
  30. style={styles.slogan}>
  31. Keep calm and keep reporting
  32. </Text>
  33. <View style={styles.SectionStyle}>
  34. <Image source={require('./img/person.png')} style={styles.ImageStyle}/>
  35. <TextInput
  36. placeholder='Email'
  37. placeholderTextColor='white'
  38. onChangeText={TextInputUser => this.setState({TextInputUser})}
  39. underlineColorAndroid='transparent'
  40. style={styles.TextInputStyleClass}
  41. />
  42. </View>
  43.  
  44. <View style={styles.SectionStyle}>
  45. <Image source={require('./img/lock.png')} style={styles.ImageStyle}/>
  46. <TextInput
  47. secureTextEntry={true}
  48. placeholder='Password'
  49. placeholderTextColor='white'
  50. onChangeText={TextInputPassword => this.setState({TextInputPassword})}
  51. underlineColorAndroid='transparent'
  52. style={styles.TextInputStyleClass}
  53. />
  54. </View>
  55. <View style={styles.SectionStyle}>
  56. <Image source={require('./img/language.png')} style={styles.ImageStyle}/>
  57. <TextInput
  58. placeholder='Server url'
  59. placeholderTextColor='white'
  60. onChangeText={TextInputServer => this.setState({TextInputServer})}
  61. underlineColorAndroid='transparent'
  62. style={styles.TextInputStyleClass}
  63. />
  64. </View>
  65.  
  66. <TouchableOpacity
  67. onPress={() => this.props.navigation.navigate('drawerStack')}
  68. style={styles.button}>
  69. <Text style={styles.signin}>
  70. Sign In
  71. </Text>
  72. </TouchableOpacity>
  73.  
  74. <Text
  75. style={styles.textLink}
  76. onPress={() => this.props.navigation.navigate('forgottenPasswordScreen')} >
  77. Forgot password?
  78. </Text>
  79.  
  80. <Text
  81. style={styles.signup}
  82. onPress={() => this.props.navigation.navigate('signupScreen')} >
  83. Sign up
  84. </Text>
  85.  
  86. <Text
  87. style={styles.copyright}>
  88. Copyright © Arter Oy 2017
  89. </Text>
  90. </ImageBackground>
  91. )
  92. }
  93. }
  94.  
  95. const styles = StyleSheet.create({
  96. ImageStyle: {
  97. paddingTop: 10,
  98. paddingBottom: 15,
  99. paddingRight: 10,
  100. margin: 5,
  101. height: 25,
  102. width: 25,
  103. resizeMode : 'stretch',
  104. alignItems: 'center'
  105. },
  106.  
  107. SectionStyle: {
  108. flexDirection: 'row',
  109. justifyContent: 'center',
  110. alignItems: 'center',
  111. backgroundColor: 'transparent',
  112. borderBottomWidth: 1,
  113. borderBottomColor: 'white',
  114. alignSelf: 'center',
  115. height: 40,
  116. width: 250,
  117. margin: 10
  118. },
  119.  
  120. TextInputStyleClass: {
  121.  
  122. //textAlign: 'center',
  123. width: 215,
  124. height: 40,
  125. fontFamily: 'Roboto-Light',
  126. fontSize: 16,
  127. color: 'white',
  128. alignSelf: 'center',
  129. //borderWidth: 1,
  130. //borderColor: '#FF5722',
  131.  
  132. // Set border Radius.
  133. //borderRadius: 10 ,
  134. },
  135.  
  136. button: {
  137. backgroundColor: '#9dcbe5',
  138. marginTop:30,
  139. paddingTop:10,
  140. paddingBottom:10,
  141. marginLeft:115,
  142. marginRight:115,
  143. marginBottom: 25,
  144. borderRadius:10,
  145. borderWidth: 1,
  146. borderColor: '#9dcbe5',
  147.  
  148. },
  149.  
  150. signin: {
  151. color: '#274752',
  152. fontFamily: 'Roboto-Light',
  153. fontSize: 15,
  154. textAlign: 'center',
  155. },
  156.  
  157. contentContainer: {
  158. padding: 20,
  159. flex: 1,
  160. width: null,
  161. height: null,
  162. backgroundColor: 'transparent',
  163. justifyContent: 'center',
  164. },
  165.  
  166. textLink: {
  167. color: 'white',
  168. paddingTop: 20,
  169. fontFamily: 'Roboto-Light',
  170. fontSize: 14,
  171. textAlign: 'center'
  172. },
  173.  
  174. signup: {
  175. color: '#78d3f2',
  176. paddingTop: 25,
  177. fontFamily: 'Roboto-Light',
  178. fontSize: 15,
  179. textAlign: 'center'
  180. },
  181.  
  182. title: {
  183. fontFamily: 'Roboto-Light',
  184. fontSize: 30,
  185. textAlign: 'center',
  186. marginTop: 10,
  187. paddingBottom: 30,
  188. color: 'white',
  189. //fontWeight: 'bold'
  190. },
  191.  
  192. slogan: {
  193. fontSize: 25,
  194. width: 200,
  195. textAlign: 'center',
  196. paddingBottom: 30,
  197. color: 'white',
  198. fontFamily: 'Allura-Regular',
  199. alignSelf: 'center',
  200. //fontWeight: 'bold'
  201. },
  202.  
  203. copyright: {
  204. fontFamily: 'Roboto-Light',
  205. color: 'white',
  206. textAlign: 'center',
  207.  
  208. marginTop: 50,
  209. }
  210. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement