2022-09-16 20:06:52 +00:00
|
|
|
import { View, TouchableOpacity, Text } from 'react-native';
|
2022-09-16 22:00:29 +00:00
|
|
|
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
|
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
2022-09-16 20:06:52 +00:00
|
|
|
import { NavigationContainer } from '@react-navigation/native';
|
2022-09-16 22:00:29 +00:00
|
|
|
import Ionicons from '@expo/vector-icons/AntDesign';
|
2022-09-16 20:06:52 +00:00
|
|
|
import { useSession } from './useSession.hook';
|
2022-09-16 22:00:29 +00:00
|
|
|
import { styles } from './Session.styled';
|
|
|
|
import Colors from 'constants/Colors';
|
2022-09-12 22:18:27 +00:00
|
|
|
|
2022-09-07 07:32:06 +00:00
|
|
|
export function Session() {
|
2022-09-12 22:18:27 +00:00
|
|
|
|
2022-09-16 20:06:52 +00:00
|
|
|
const { state, actions } = useSession();
|
|
|
|
|
|
|
|
const Tab = createBottomTabNavigator();
|
|
|
|
|
2022-09-16 22:00:29 +00:00
|
|
|
const Conversation = () => (<TouchableOpacity style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }} onPress={actions.logout}><Text>LOGOUT</Text></TouchableOpacity>);
|
2022-09-16 20:06:52 +00:00
|
|
|
|
2022-09-16 22:00:29 +00:00
|
|
|
const Profile = () => (<SafeAreaView edges={['top']}><View style={{ width: '100%', height: '100%', backgroundColor: 'yellow'}} /></SafeAreaView>);
|
|
|
|
const Contacts = () => (<SafeAreaView edges={['top']}><View style={{ width: '100%', height: '100%', backgroundColor: 'yellow'}} /></SafeAreaView>);
|
2022-09-12 22:18:27 +00:00
|
|
|
|
|
|
|
return (
|
2022-09-16 22:00:29 +00:00
|
|
|
<SafeAreaProvider>
|
|
|
|
<NavigationContainer>
|
|
|
|
<Tab.Navigator
|
|
|
|
screenOptions={({ route }) => ({
|
|
|
|
tabBarStyle: styles.tabBar,
|
|
|
|
headerShown: false,
|
|
|
|
tabBarIcon: ({ focused, color, size }) => {
|
|
|
|
if (route.name === 'Profile') {
|
|
|
|
return <Ionicons name={'user'} size={size} color={color} />;
|
|
|
|
}
|
|
|
|
if (route.name === 'Conversation') {
|
|
|
|
return <Ionicons name={'message1'} size={size} color={color} />;
|
|
|
|
}
|
|
|
|
if (route.name === 'Contacts') {
|
|
|
|
return <Ionicons name={'contacts'} size={size} color={color} />;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
tabBarActiveTintColor: Colors.white,
|
|
|
|
tabBarInactiveTintColor: Colors.disabled,
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<Tab.Screen name="Conversation" component={Conversation} />
|
|
|
|
<Tab.Screen name="Profile" component={Profile} />
|
|
|
|
<Tab.Screen name="Contacts" component={Contacts} />
|
|
|
|
</Tab.Navigator>
|
|
|
|
</NavigationContainer>
|
|
|
|
</SafeAreaProvider>
|
2022-09-12 22:18:27 +00:00
|
|
|
);
|
2022-09-07 07:32:06 +00:00
|
|
|
}
|
|
|
|
|
2022-09-16 20:06:52 +00:00
|
|
|
|