SHARE
TWEET

Untitled

a guest Sep 13th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, {Component} from 'react';
  2. import {
  3.    AppRegistry,
  4.    StyleSheet,
  5.    Text,
  6.    View,
  7. } from 'react-native';
  8.  
  9. import { StackNavigator } from 'react-navigation';
  10.  
  11. import loginScreen from './src/components/loginView';
  12. import registerScreen from './src/components/registerView';
  13.  
  14. const Appmemes = StackNavigator({
  15.    Login: {screen: loginScreen},
  16.    Register: {screen: registerScreen}
  17. });
  18.  
  19. export default Appmemes;
  20.  
  21. AppRegistry.registerComponent('Appmemes', () => Appmemes);
  22.    
  23. .
  24. .
  25. .
  26.   <View style={styles.formContainer}>
  27.           <LoginForm/>
  28.   </View>
  29. .
  30. .
  31. .    
  32.  
  33. LoginForm.js
  34.  
  35. import React, { Component } from 'react'
  36. import { StyleSheet, TextInput, Text, View, TouchableOpacity, AppRegistry} from 'react-native'
  37. import { StackNavigator} from 'react-navigation';
  38.  
  39. export default class LoginForm extends Component{
  40.   render() {
  41.       return(
  42.       <View style={styles.container}>
  43.  
  44.           <TouchableOpacity style={styles.buttonContainer1}>
  45.             <Text style={styles.buttonText}>Entrar</Text>
  46.           </TouchableOpacity>
  47.  
  48.           <TouchableOpacity style={styles.buttonContainer2} onPress={() => this.props.navigation.navigate('Login')}>
  49.  
  50.             <Text style={styles.buttonText}>Registrarse</Text>
  51.           </TouchableOpacity>
  52.       </View>
  53.     );
  54.   }
  55. }
  56.  
  57. AppRegistry.registerComponent('LoginForm', () => LoginForm);
  58.  
  59. const styles = StyleSheet.create({...]);
  60. });
RAW Paste Data
Top