import React from 'react'; import { SafeAreaView } from 'react-native'; import { Container, Tab, Tabs, TabHeading, Text } from 'native-base'; import { connect } from "react-redux"; import CustomHeader from '../../components/header.js'; import Elements from '../../components/elements.js'; import Theme from '../../components/theme.style'; import Tab1 from './profile/profile'; import Tab2 from './card'; import Tab3 from './transaction/transaction'; import CustomSafeArea from '../../components/safeArea.component.js'; class MyProfile extends React.PureComponent { constructor(props) { super(props) } state = { px: 0, pg: null } componentDidMount() { this.init() } componentWillUnmount() { } init = async () => { let t = this.props.route.params && this.props.route.params.tab ? this.props.route.params.tab : '' let x = 0 if(t == 'ProfileCardTab') x = 1 else if(t == 'ProfileTransactionsTab') x = 2 this.setState({ pg: x }) } TabHead = (title, icon) => { return ( {title} ) } render() { return ( this.props.navigation.goBack()} menu={false} navigation={this.props} /> { this.setState({ pg: tab.i }) }}> ) } } const mapStateToProps = (state) => { return { app_theme: state.appThemeReducer.theme } } export default connect(mapStateToProps, null)(MyProfile);