diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 0a0f167..5426a26 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -18,6 +18,9 @@ import { LoadingView } from './components/Loading'; import ProfileView from './views/ProfileView'; import useColorScheme from './hooks/colorScheme'; import { Button, Center, VStack } from 'native-base'; +import { useDispatch } from 'react-redux'; +import { unsetAccessToken } from './state/UserSlice'; +import TextButton from './components/TextButton'; const protectedRoutes = () => ({ @@ -59,8 +62,9 @@ const RouteToScreen = (component: Route['component']) => (pro const routesToScreens = (routes: Partial>) => Object.entries(routes) - .map(([name, route]) => ( + .map(([name, route], routeIndex) => ( >) = )) const ProfileErrorView = (props: { onTryAgain: () => any }) => { + const dispatch = useDispatch(); return
- + dispatch(unsetAccessToken())} + colorScheme="error" variant='outline' + translate={{ translationKey: 'signOutBtn' }} + />
}