Skip to content

Commit

Permalink
Update App.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Loule95450 committed Feb 28, 2024
1 parent 1ac7632 commit 6378b12
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import React, {useEffect} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {NavigationContainer, useNavigation} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useCameraPermission} from 'react-native-vision-camera';
import {ColorValue} from 'react-native';
import LoginScreen from './screens/login/LoginScreen.tsx';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {logger} from 'react-native-logs';

const Tab = createBottomTabNavigator();
const log = logger.createLogger();

const LastScanScreen = () => null;
const PlateScreen = () => null;
const QRScanScreen = () => null;
const SearchScreen = () => null;

const App = () => {
const navigation = useNavigation();
const {hasPermission, requestPermission} = useCameraPermission();
const renderIcon =
(name: string) =>
Expand All @@ -27,6 +31,16 @@ const App = () => {
}
}, [hasPermission, requestPermission]);

useEffect(() => {
AsyncStorage.getItem('user').then(user => {
if (user) {
log.info('user token', {user});
} else {
log.error('no user token');
}
});
}, [navigation]);

return (
<NavigationContainer>
<Tab.Navigator>
Expand Down Expand Up @@ -63,6 +77,9 @@ const App = () => {
component={LoginScreen}
options={{
tabBarIcon: renderIcon('account-circle'),
tabBarStyle: {
display: 'none',
},
}}
/>
</Tab.Navigator>
Expand Down

0 comments on commit 6378b12

Please sign in to comment.