-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
35 lines (30 loc) · 930 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { useEffect, type FC } from 'react';
import { SafeAreaView, StatusBar } from 'react-native';
import Navigation from './src/navigation';
import { Provider } from 'react-redux';
import { store } from './src/store';
import { supabase } from './src/helpers/supabase';
import { useTypedDispatch } from './src/hooks/useStore';
import { getProfile, updateSession } from './src/store/authSlice';
import global from './src/styles/global';
const App: FC = () => {
const dispatch = useTypedDispatch();
useEffect(() => {
dispatch(getProfile());
supabase.auth.onAuthStateChange((_event, session) => {
dispatch(updateSession(session));
});
}, [dispatch]);
return (
<SafeAreaView style={global.fill}>
<StatusBar barStyle="light-content" />
<Navigation />
</SafeAreaView>
);
};
const Wrapper: FC = () => (
<Provider store={store}>
<App />
</Provider>
);
export default Wrapper;