import React, {Component} from 'react';
import {StyleSheet, View, Text, TouchableOpacity} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import home_navigation from './home_navigation';
import personal_navigation from './personal_navigation';
import {RetrieveData} from '../../data/storage';
import message_list from '../../page/tax_message/message_list';
import tax_navigation from './tax_navigation';
function MyTabBar({state, descriptors, navigation}) {
return (
{state.routes.map((route, index) => {
const {options} = descriptors[route.key];
const label =
options.tabBarLabel !== undefined
? options.tabBarLabel
: options.title !== undefined
? options.title
: route.name;
const isFocused = state.index === index;
const onPress = () => {
const event = navigation.emit({
type: 'tabPress',
target: route.key,
});
if (!isFocused && !event.defaultPrevented) {
navigation.navigate(route.name);
}
};
const onLongPress = () => {
navigation.emit({
type: 'tabLongPress',
target: route.key,
});
};
return (
{label}
);
})}
);
}
const Tab = createBottomTabNavigator();
export default class Main_tab_navigation extends Component {
constructor(props) {
super(props);
this.state = {
authority: '',
};
}
render() {
return (
}>
(
//
// ),
}}
/>
(
// //
//
// ),
}}
// initialParams={this.state.authority}
/>
(
//
// ),
}}
/>
);
}
componentDidMount(): void {
this.getAuthority();
}
getAuthority = async () => {
let authority = await RetrieveData('authority');
if (authority) {
this.setState({
authority: authority,
});
}
};
}