|
@@ -3,6 +3,7 @@ import { Text } from 'react-native';
|
|
|
import { connect } from 'react-redux';
|
|
import { connect } from 'react-redux';
|
|
|
import { Card, CardSection, Input, Button, Spinner } from './common';
|
|
import { Card, CardSection, Input, Button, Spinner } from './common';
|
|
|
import { emailChanged, passwordChanged, loginUser } from '../actions/';
|
|
import { emailChanged, passwordChanged, loginUser } from '../actions/';
|
|
|
|
|
+import { Actions } from 'react-native-router-flux';
|
|
|
|
|
|
|
|
class LoginForm extends Component {
|
|
class LoginForm extends Component {
|
|
|
|
|
|
|
@@ -14,7 +15,10 @@ class LoginForm extends Component {
|
|
|
this.props.passwordChanged(text);
|
|
this.props.passwordChanged(text);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- onButtonPress(){
|
|
|
|
|
|
|
+ onRegisterPress() {
|
|
|
|
|
+ Actions.register();
|
|
|
|
|
+ }
|
|
|
|
|
+ onLoginPress(){
|
|
|
const { email, password } = this.props;
|
|
const { email, password } = this.props;
|
|
|
this.props.loginUser({ email, password });
|
|
this.props.loginUser({ email, password });
|
|
|
}
|
|
}
|
|
@@ -24,8 +28,8 @@ class LoginForm extends Component {
|
|
|
return <Spinner size="large" />;
|
|
return <Spinner size="large" />;
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
- <Button onPress={this.onButtonPress.bind(this)}>
|
|
|
|
|
- Login
|
|
|
|
|
|
|
+ <Button onPress={this.onLoginPress.bind(this)}>
|
|
|
|
|
+ Ingresar
|
|
|
</Button>
|
|
</Button>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -57,6 +61,11 @@ class LoginForm extends Component {
|
|
|
<CardSection>
|
|
<CardSection>
|
|
|
{this.renderButton()}
|
|
{this.renderButton()}
|
|
|
</CardSection>
|
|
</CardSection>
|
|
|
|
|
+ <CardSection>
|
|
|
|
|
+ <Button onPress={this.onRegisterPress.bind(this)}>
|
|
|
|
|
+ Registrarse
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </CardSection>
|
|
|
</Card>
|
|
</Card>
|
|
|
|
|
|
|
|
);
|
|
);
|