Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. import React, {Component} from 'react';
  2. import {View, Text, TextInput, TouchableOpacity} from 'react-native';
  3. import styles from './style';
  4.  
  5. class Home extends Component {
  6. state = {
  7. username: '',
  8. };
  9.  
  10. render() {
  11. return (
  12. <View style={styles.Component}>
  13. <Text style={styles.Title}>Welcome to Repos List App</Text>
  14. <View style={styles.Form}>
  15. <View style={styles.FormRow}>
  16. <Text style={styles.Label}>Username: @</Text>
  17. <TextInput
  18. style={styles.Input}
  19. onChangeText={username => this.setState({username})}
  20. value={this.state.username}
  21. />
  22. </View>
  23. <TouchableOpacity
  24. style={styles.Button}
  25. onPress={() => {
  26. this.props.navigation.navigate('List', {
  27. name: this.state.username,
  28. });
  29. }}>
  30. <Text>Search</Text>
  31. </TouchableOpacity>
  32. </View>
  33. </View>
  34. );
  35. }
  36. }
  37.  
  38. Home.navigationOptions = {
  39. title: 'Home',
  40. };
  41.  
  42. export default Home;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement