From 6378b127bb212c2bfe830c1b267016d7ef0554e1 Mon Sep 17 00:00:00 2001 From: Loule | Louis <35641311+Loule95450@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:18:06 +0100 Subject: [PATCH] Update App.tsx --- src/App.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index c725c2c2..dcdf70a4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,12 +1,15 @@ 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; @@ -14,6 +17,7 @@ const QRScanScreen = () => null; const SearchScreen = () => null; const App = () => { + const navigation = useNavigation(); const {hasPermission, requestPermission} = useCameraPermission(); const renderIcon = (name: string) => @@ -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 ( @@ -63,6 +77,9 @@ const App = () => { component={LoginScreen} options={{ tabBarIcon: renderIcon('account-circle'), + tabBarStyle: { + display: 'none', + }, }} />