Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from "react";
- import {
- Image,
- Text,
- TextInput,
- Platform,
- StyleSheet,
- TouchableOpacity
- } from "react-native";
- import {
- Container,
- Tabs,
- Tab,
- Header,
- Title,
- ScrollableTab,
- View,
- Form,
- Label,
- Left,
- Right
- } from "native-base";
- import { NavigationActions, StackActions } from "react-navigation";
- import { connect } from "react-redux";
- import globalStyles, { height, width, colors } from "../customLib/globalStyle";
- import RegisterScreen from "./RegisterScreen";
- import { updateInitTab } from "../Redux/actions/auth";
- class LoginScreen extends Component {
- constructor(props) {
- super(props);
- this.state = {
- email: "",
- password: ""
- };
- }
- render() {
- return (
- <Container>
- ...
- <Tabs
- onChangeTab={val => this.props.updateInitTab(val.i)}
- initialPage={this.props.initPage}
- tabBarUnderlineStyle={{ backgroundColor: colors.BLUE }}
- >
- <Tab heading="Masuk" >
- <Text> Masuk </Text>
- </Tab>
- <Tab heading="Daftar" >
- <RegisterScreen {...this.props} updatePage={val => this.props.updateInitTab(val)} />
- </Tab>
- </Tabs>
- </Container>
- );
- }
- }
- const mapStateToProps = ({ auth }) => ({
- initPage: auth.initPage
- });
- const mapDispatchToProps = dispatch => ({
- updateInitTab: int => dispatch(updateInitTab(int))
- });
- export default connect(
- mapStateToProps,
- mapDispatchToProps
- )(LoginScreen);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement