Advertisement
Guest User

Principal.js

a guest
Mar 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import {
  3.   StyleSheet,
  4.   Text,
  5.   View,
  6.   TextInput,
  7.   Button,
  8.   TouchableHighlight,
  9.   ImageBackground
  10. } from 'react-native';
  11. import {Actions} from 'react-native-router-flux';
  12. import {connect} from 'react-redux';
  13.  
  14. import { modificaEmail, modificaSenha } from '../actions/AutenticacaoAction';
  15.  
  16. const bg = require('../imgs/bg.png');
  17.  
  18. const Principal = (props) => {
  19.   console.log(props)
  20.     return (
  21.       <ImageBackground style={{flex:1} source={bg}>
  22.        
  23.             <View style={styles.topo}>
  24.               <Text style={styles.txtTopo}>
  25.                 WhatsApp Clone!
  26.               </Text>
  27.             </View>
  28.  
  29.             <View style={styles.centro}>
  30.               <TextInput  style={{fontSize: 20, height: 45}} placeholder='E-mail'/>
  31.               <TextInput secureTextEntry  style={{fontSize: 20, height: 45}} placeholder='Senha'/>
  32.              
  33.               <TouchableHighlight  onPress={() => Actions.Cadastrar()} activeOpacity={0.3} underlayColor='#F5FCFF'>
  34.                 <Text style={{fontSize: 20}}>Ainda não tem cadastro? Cadastre-se </Text>
  35.               </TouchableHighlight>
  36.             </View>
  37.  
  38.             <View style={styles.bottom}>
  39.               <Button title='Entrar' color='#115E54' onPress={() => false} />
  40.             </View>
  41.        
  42.       </ImageBackground>
  43.     );
  44.  
  45. }
  46.  
  47. const styles = StyleSheet.create({
  48.   container: {
  49.     flex: 1,
  50.     backgroundColor: '#F5FCFF',
  51.     padding: 10,
  52.    
  53.   },
  54.   txtTopo: {
  55.     fontSize: 25,
  56.     textAlign: 'center',
  57.     margin: 10
  58.   },
  59.   topo: {
  60.     flex: 1,
  61.     justifyContent: 'center',
  62.     alignItems: 'center',
  63.   },
  64.   centro: {
  65.     flex: 2
  66.   },
  67.   bottom: {
  68.     flex: 2
  69.   }
  70. });
  71.  
  72. const mapStateToProps = (state) => (
  73.   {
  74.     email: state.AutenticacaoReducer.email,
  75.     senha: state.AutenticacaoReducer.senha
  76.   }
  77. )
  78.  
  79.  
  80.  
  81. const PrincipalComponent = connect(mapStateToProps, { modificaEmail, modificaSenha })(Principal);
  82.  
  83. export {
  84.   PrincipalComponent as Principal
  85. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement