Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. You input {this.state.zip}.
  2.  
  3. import React, { Component } from 'react';
  4. import {
  5. AppRegistry,
  6. StyleSheet,
  7. Text,
  8. TextInput,
  9. Image,
  10. View
  11. } from 'react-native';
  12.  
  13. class WeatherProject extends Component {
  14. // If you want to have a default zip code, you could add one here
  15. getInitialState() {
  16. return ({
  17. zip: ''
  18. });
  19. }
  20. // We'll pass this callback to the <TextInput>
  21. _handleTextChange(event) {
  22. // log statements are viewable in Xcode,
  23. // or the Chrome debug tools
  24. console.log(event.nativeEvent.text);
  25.  
  26. this.setState({
  27. zip: event.nativeEvent.text
  28. });
  29. }
  30. render() {
  31. return (
  32. <View style={styles.container}>
  33. <Text style={styles.welcome}>
  34. You input {this.state.zip}.
  35. </Text>
  36. <TextInput
  37. style={styles.input}
  38. onSubmitEditing={this._handleTextChange}/>
  39. </View>
  40. );
  41. }
  42. }
  43.  
  44. var styles = StyleSheet.create({
  45. container: {
  46. flex: 1,
  47. justifyContent: 'center',
  48. alignItems: 'center',
  49. backgroundColor: '#F5FCFF',
  50. },
  51. welcome: {
  52. fontSize: 20,
  53. borderWidth: 2,
  54. height: 40
  55. }
  56. });
  57.  
  58. AppRegistry.registerComponent('WeatherProject', () => WeatherProject);
  59. [enter image description here][1]
  60.  
  61. class WeatherProject extends Component {
  62. constructor(props){
  63. super(props);
  64. this.state = {
  65. zip: ""
  66. }
  67. }
  68. }
  69.  
  70. getInitialState() {
  71. return ({
  72. zip: ''
  73. });
  74. }
  75.  
  76. constructor() {
  77. super();
  78. this.state = {
  79. zip: ''
  80. }
  81. }
  82.  
  83. return (
  84. <Container>
  85. <Content style={styles.container}>
  86. <View>
  87. <ScrollView style={styles.scrollView}>
  88. <View style={styles.card}>
  89. <TouchableOpacity
  90.  
  91. onPress={()=>{this.props.navigation.navigate("JoinDetailPage")}}
  92. >
  93. <View style={{ flexDirection: "row" }}>
  94. <View style={{ flex: 1 }}>
  95. <Text style={{ fontWeight: "bold" }}>Pokers Event</Text>
  96. </View>
  97. <View
  98. style={{
  99. flex: 1,
  100. alignItems: "flex-end",
  101. marginRight: 3
  102. }}>
  103. <Text>Hosted By</Text>
  104. </View>
  105. </View>
  106. <View
  107. style={{
  108. flex: 1,
  109. alignContent: "flex-end",
  110. alignItems: "flex-end",
  111. marginRight: 3
  112. }}>
  113. <Text style={{ fontWeight: "bold" }}>John</Text>
  114. </View>
  115.  
  116. <View style={{ flexDirection: "row" }}>
  117. <View
  118. style={{ flex: 1, flexDirection: "row", marginRight: 3 }}>
  119. <View>
  120. <Image
  121. style={{ width: 15, height: 15 }}
  122. source={require("./../../../../assets/location.png")}
  123. />
  124. </View>
  125. <View>
  126. <Text style={{ marginLeft: 10, fontSize: 13 }}>
  127. Divine Lahore
  128. </Text>
  129. </View>
  130. </View>
  131. <View
  132. style={{
  133. flexDirection: "row",
  134. alignContent: "flex-end",
  135. alignItems: "flex-end"
  136. }}>
  137. <Text
  138. style={{
  139. marginLeft: 10,
  140. fontSize: 13,
  141. fontWeight: "bold",
  142. color: "#a78c52"
  143. }}>
  144. 2.0
  145. </Text>
  146.  
  147. <Image
  148. style={{ width: 15, height: 15, marginLeft: 5 }}
  149. source={require("./../../../../assets/star.png")}
  150. />
  151. </View>
  152. </View>
  153.  
  154. <View style={{ flexDirection: "row", marginTop: 5 }}>
  155. <View>
  156. <Image
  157. style={{ width: 15, height: 15 }}
  158. source={require("./../../../../assets/calendar.png")}
  159. />
  160. </View>
  161. <View>
  162. <Text style={{ marginLeft: 10, fontSize: 13 }}>
  163. 12/10/2019
  164. </Text>
  165. </View>
  166. </View>
  167. <View style={{ flexDirection: "row", marginTop: 5 }}>
  168. <View>
  169. <Image
  170. style={{ width: 15, height: 15 }}
  171. source={require("./../../../../assets/gametype.png")}
  172. />
  173. </View>
  174. <View>
  175. <Text style={{ marginLeft: 10, fontSize: 13 }}>cash</Text>
  176. </View>
  177. </View>
  178. </TouchableOpacity>
  179. </View>
  180. </ScrollView>
  181. </View>
  182. </Content>
  183. </Container>
  184. ); } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement