import React from 'react'; import { Text } from 'react-native'; import { Container } from 'native-base'; import { connect } from "react-redux"; import { Tabs } from '../../components/tab'; 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() } 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} ) } sceneMap = () => { const listofTabs = { first: () => , second: () => , third: () => } return listofTabs; } routes = () => { const listofTabBar = [ { key: 'first', title: 'Profile', activeIcon: "activeaccount", inActiveIcon: "inactiveaccount" }, { key: 'second', title: 'My Card', activeIcon: "activecard", inActiveIcon: "inactivecard" }, { key: 'third', title: 'Transactions', activeIcon: "activehistory", inActiveIcon: "history" }, ]; return listofTabBar } render() { const { tab } = this.props.route.params; return ( this.props.navigation.goBack()} menu={false} navigation={this.props} /> ) } } const mapStateToProps = (state) => { return { app_theme: state.appThemeReducer.theme } } export default connect(mapStateToProps, null)(MyProfile);