|
@@ -1,8 +1,8 @@
|
|
|
import React, { Component} from 'react';
|
|
import React, { Component} from 'react';
|
|
|
-import { Text } from 'react-native';
|
|
|
|
|
|
|
+import { Text, TextInput, View, Image, TouchableOpacity } from 'react-native';
|
|
|
import { connect } from 'react-redux';
|
|
import { connect } from 'react-redux';
|
|
|
import { Actions } from 'react-native-router-flux';
|
|
import { Actions } from 'react-native-router-flux';
|
|
|
-import { Card, CardSection, Input, Button, Spinner } from '../components/common';
|
|
|
|
|
|
|
+import { Button, Spinner } from '../components/common';
|
|
|
import { emailChanged, passwordChanged, loginUser } from '../actions/';
|
|
import { emailChanged, passwordChanged, loginUser } from '../actions/';
|
|
|
|
|
|
|
|
class LoginForm extends Component {
|
|
class LoginForm extends Component {
|
|
@@ -25,7 +25,7 @@ class LoginForm extends Component {
|
|
|
|
|
|
|
|
renderButton() {
|
|
renderButton() {
|
|
|
if (this.props.loading) {
|
|
if (this.props.loading) {
|
|
|
- return <Spinner size="large" />;
|
|
|
|
|
|
|
+ return <Spinner style={{height:40}} size="large" />;
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
<Button onPress={this.onLoginPress.bind(this)}>
|
|
<Button onPress={this.onLoginPress.bind(this)}>
|
|
@@ -35,40 +35,53 @@ class LoginForm extends Component {
|
|
|
}
|
|
}
|
|
|
render() {
|
|
render() {
|
|
|
return (
|
|
return (
|
|
|
- <Card>
|
|
|
|
|
- <CardSection>
|
|
|
|
|
- <Input
|
|
|
|
|
- label="Email"
|
|
|
|
|
- placeholder="email@gmail.com"
|
|
|
|
|
- value={this.props.email}
|
|
|
|
|
- onChangeText={this.onEmailChange.bind(this)}
|
|
|
|
|
- />
|
|
|
|
|
- </CardSection>
|
|
|
|
|
-
|
|
|
|
|
- <CardSection>
|
|
|
|
|
- <Input
|
|
|
|
|
- secureTextEntry
|
|
|
|
|
- label="Clave"
|
|
|
|
|
- placeholder="clave"
|
|
|
|
|
- value={this.props.password}
|
|
|
|
|
- onChangeText={this.onPasswordChange.bind(this)}
|
|
|
|
|
- />
|
|
|
|
|
- </CardSection>
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ style={{flex:1,
|
|
|
|
|
+ backgroundColor:'#3B618B',
|
|
|
|
|
+ alignItems:'center',
|
|
|
|
|
+ paddingTop: 55}}>
|
|
|
|
|
+
|
|
|
|
|
+ <Image source={require('../../img/logo.png')}
|
|
|
|
|
+ resizeMode='contain'
|
|
|
|
|
+ style={{height:80, marginTop: 20, marginBottom: 20}}
|
|
|
|
|
+ />
|
|
|
|
|
+ <Text
|
|
|
|
|
+ style={{color:'white',fontSize:18, marginBottom: 30}}
|
|
|
|
|
+ >
|
|
|
|
|
+ PLATAFORMA DE ESTUDIO
|
|
|
|
|
+ </Text>
|
|
|
|
|
+
|
|
|
|
|
+ <TextInput
|
|
|
|
|
+ placeholder="email@gmail.com"
|
|
|
|
|
+ value={this.props.email}
|
|
|
|
|
+ onChangeText={this.onEmailChange.bind(this)}
|
|
|
|
|
+ style={styles.inputStyle}
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <TextInput
|
|
|
|
|
+ secureTextEntry
|
|
|
|
|
+ placeholder="contraseña"
|
|
|
|
|
+ value={this.props.password}
|
|
|
|
|
+ onChangeText={this.onPasswordChange.bind(this)}
|
|
|
|
|
+ style={styles.inputStyle}
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <TouchableOpacity style={{alignSelf: 'stretch'}}>
|
|
|
|
|
+ <Text style={styles.forgotStyle}>
|
|
|
|
|
+ Olvido su contraseña?
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
|
|
|
<Text style={styles.errorTextStyle}>
|
|
<Text style={styles.errorTextStyle}>
|
|
|
{this.props.error}
|
|
{this.props.error}
|
|
|
</Text>
|
|
</Text>
|
|
|
|
|
|
|
|
- <CardSection>
|
|
|
|
|
- {this.renderButton()}
|
|
|
|
|
- </CardSection>
|
|
|
|
|
- <CardSection>
|
|
|
|
|
- <Button onPress={this.onRegisterPress.bind(this)}>
|
|
|
|
|
- Registrarse
|
|
|
|
|
- </Button>
|
|
|
|
|
- </CardSection>
|
|
|
|
|
- </Card>
|
|
|
|
|
|
|
+ {this.renderButton()}
|
|
|
|
|
|
|
|
|
|
+ <Button onPress={this.onRegisterPress.bind(this)}>
|
|
|
|
|
+ Registrarse
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </View>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -78,7 +91,30 @@ const styles = {
|
|
|
fontSize: 20,
|
|
fontSize: 20,
|
|
|
alignSelf: 'center',
|
|
alignSelf: 'center',
|
|
|
color: 'red'
|
|
color: 'red'
|
|
|
|
|
+ },
|
|
|
|
|
+ inputStyle: {
|
|
|
|
|
+ alignSelf: 'stretch',
|
|
|
|
|
+ color:'#1E3146',
|
|
|
|
|
+ backgroundColor:'#D8DFE8',
|
|
|
|
|
+ fontSize: 14,
|
|
|
|
|
+ height: 35,
|
|
|
|
|
+ borderRadius: 8,
|
|
|
|
|
+ paddingTop: 10,
|
|
|
|
|
+ paddingLeft: 10,
|
|
|
|
|
+ paddingBottom: 10,
|
|
|
|
|
+ marginBottom: 10,
|
|
|
|
|
+ marginLeft: 20,
|
|
|
|
|
+ marginRight: 20,
|
|
|
|
|
+ textDecorationLine: 'none'
|
|
|
|
|
+ },
|
|
|
|
|
+ forgotStyle: {
|
|
|
|
|
+ color:'#F1F2F2',
|
|
|
|
|
+ textAlign:'right',
|
|
|
|
|
+ marginRight: 20,
|
|
|
|
|
+ marginBottom: 15,
|
|
|
|
|
+ fontSize: 12
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = ({ auth }) => {
|
|
const mapStateToProps = ({ auth }) => {
|