-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
69 lines (58 loc) · 1.92 KB
/
App.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* eslint-disable react/jsx-filename-extension */
/* eslint-disable camelcase */
import React, { useEffect } from "react";
import { createStore, combineReducers, applyMiddleware } from "redux";
import ReduxThunk from "redux-thunk";
import { Provider } from "react-redux";
import AppLoading from "expo-app-loading";
import { OverflowMenuProvider } from "react-navigation-header-buttons";
import {
Inter_400Regular,
Inter_700Bold,
useFonts,
} from "@expo-google-fonts/inter";
import * as Sentry from "sentry-expo";
import AppNavigator from "./navigation/AppNavigator";
import authReducer from "./store/authReducer";
import scrobblesReducer from "./store/scrobblesReducer";
import { getSpotifyToken } from "./utils/spotify";
Sentry.init({
dsn:
"https://9b633e0f819348a3b8f6d603cac7d211@o270434.ingest.sentry.io/5783875",
enableInExpoDevelopment: true,
debug: `${process.env.DEV === true}`, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production.
});
// // Access any @sentry/react-native exports via:
// Sentry.Native.*
// // Access any @sentry/browser exports via:
// Sentry.Browser.*
const roorReducer = combineReducers({
auth: authReducer,
scrobbles: scrobblesReducer,
});
const store = createStore(roorReducer, applyMiddleware(ReduxThunk));
// Disabled those lines in order to make the stacks screens work with the new Expo SDK 40 update.
// import { enableScreens } from 'react-native-screens'
// enableScreens()
export default function App() {
const [fontsLoaded] = useFonts({
Inter_400Regular,
Inter_700Bold,
});
useEffect(() => {
const fetchData = async () => {
await getSpotifyToken();
};
fetchData();
}, []);
if (!fontsLoaded) {
return <AppLoading />;
}
return (
<Provider store={store}>
<OverflowMenuProvider>
<AppNavigator />
</OverflowMenuProvider>
</Provider>
);
}