forked from react-native-community/directory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_app.tsx
51 lines (46 loc) · 1.77 KB
/
_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import Head from 'next/head';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { colors, darkColors } from '../common/styleguide';
import Footer from '../components/Footer';
import Header from '../components/Header';
import CustomAppearanceContext from '../context/CustomAppearanceContext';
// eslint-disable-next-line
import CustomAppearanceProvider from '../context/CustomAppearanceProvider';
import '../styles/styles.css';
import ThemedBody from '../styles/ThemedBody';
Sentry.init({
enabled: process.env.NODE_ENV === 'production',
allowUrls: process.env.NODE_ENV === 'production' ? [/https:\/\/reactnative\.directory/] : [],
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.5 : 1.0,
});
const App = ({ pageProps, Component }) => (
<CustomAppearanceProvider>
<CustomAppearanceContext.Consumer>
{context => (
<SafeAreaProvider
style={{
flex: 1,
backgroundColor: context.isDark ? darkColors.background : colors.white,
}}>
<Head>
<title>React Native Directory</title>
<meta
name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
/>
</Head>
<Header />
<Component {...pageProps} />
<Footer />
<ThemedBody />
</SafeAreaProvider>
)}
</CustomAppearanceContext.Consumer>
</CustomAppearanceProvider>
);
export default Sentry.withProfiler(App);