Guest User

Untitled

a guest
Dec 8th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. 'use strict';
  2. import React, { Component } from 'react'
  3. var Dimensions = require('Dimensions');
  4. var windowSize = Dimensions.get('window');
  5.  
  6. import {
  7. AppRegistry,
  8. StyleSheet,
  9. View,
  10. Text,
  11. TextInput,
  12. Image
  13. } from 'react-native';
  14.  
  15. class LoginPage extends Component {
  16. constructor() {
  17. super()
  18. this.state = {
  19. username: '',
  20. password: ''
  21. }
  22. }
  23. render() {
  24. return (
  25. <View style={styles.container}>
  26. <Image style={styles.bg} source={require('./Resources/orangebackground.png')} />
  27. <View style={styles.header}>
  28. <Image source={require('./Resources/logo.png')} />
  29. </View>
  30. <View style={styles.inputs}>
  31. <View style={styles.inputContainer}>
  32. <Image style={styles.inputUsername} source={require('./Resources/un.png')}/>
  33. <TextInput
  34. style={[styles.input, styles.whiteFont]}
  35. underlineColorAndroid={'white'}
  36. placeholder='Username'
  37. placeholderTextColor="white"
  38. //value={this.state.username}
  39. />
  40. </View>
  41. <View style={styles.inputContainer}>
  42. <Image style={styles.inputPassword} source={require('./Resources/pw.png')}/>
  43. <TextInput
  44. password={true}
  45. style={[styles.input, styles.whiteFont]}
  46. placeholder="Password"
  47. placeholderTextColor="#FFF"
  48. underlineColorAndroid={'transparent'}
  49. //value={this.state.password}
  50. />
  51. </View>
  52. <View style={styles.forgotContainer}>
  53. <Text style={styles.greyFont}>Forgot Password</Text>
  54. </View>
  55. </View>
  56. <View style={styles.signin}>
  57. <Text style={styles.whiteFont}>Sign In</Text>
  58. </View>
  59. <View style={styles.signup}>
  60. <Text style={styles.greyFont}>Don't have an account?<Text style={styles.whiteFont}> Sign Up</Text></Text>
  61. </View>
  62. </View>
  63. );
  64. }
  65. }
  66.  
  67. var styles = StyleSheet.create({
  68. container: {
  69. flexDirection: 'column',
  70. flex: 1,
  71. backgroundColor: 'transparent'
  72. },
  73. bg: {
  74. position: 'absolute',
  75. left: 0,
  76. top: 0,
  77. width: windowSize.width,
  78. height: windowSize.height
  79. },
  80. header: {
  81. justifyContent: 'center',
  82. alignItems: 'center',
  83. flex: .5,
  84. backgroundColor: 'transparent'
  85. },
  86. mark: {
  87. width: 150,
  88. height: 150
  89. },
  90. signin: {
  91. backgroundColor: '#FF3366',
  92. padding: 20,
  93. alignItems: 'center'
  94. },
  95. signup: {
  96. justifyContent: 'center',
  97. alignItems: 'center',
  98. flex: .15
  99. },
  100. inputs: {
  101. marginTop: 10,
  102. marginBottom: 10,
  103. flex: .25
  104. },
  105. inputPassword: {
  106. marginLeft: 15,
  107. width: 20,
  108. height: 21
  109. },
  110. inputUsername: {
  111. marginLeft: 15,
  112. width: 20,
  113. height: 20
  114. },
  115. inputContainer: {
  116. padding: 10,
  117. borderWidth: 1,
  118. borderBottomColor: '#CCC',
  119. borderColor: 'transparent'
  120. },
  121. input: {
  122. position: 'absolute',
  123. left: 61,
  124. top: 12,
  125. right: 0,
  126. height: 20,
  127. fontSize: 14
  128. },
  129. forgotContainer: {
  130. alignItems: 'flex-end',
  131. padding: 15,
  132. },
  133. greyFont: {
  134. color: '#D8D8D8'
  135. },
  136. whiteFont: {
  137. color: '#FFF'
  138. }
  139. })
  140.  
  141. <TextInput style={[styles.input, {height: Platform.OS == 'android' ? 40 : 20}]} ... />
Add Comment
Please, Sign In to add comment