forked from solana-mobile/solana-mobile-expo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
88 lines (81 loc) · 2.24 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Polyfills
import "./src/polyfills";
import { StyleSheet, useColorScheme } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { ConnectionProvider } from "./src/utils/ConnectionProvider";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import {
DarkTheme as NavigationDarkTheme,
DefaultTheme as NavigationDefaultTheme,
} from "@react-navigation/native";
import {
PaperProvider,
MD3DarkTheme,
MD3LightTheme,
adaptNavigationTheme,
} from "react-native-paper";
import { AppNavigator } from "./src/navigators/AppNavigator";
import { ClusterProvider } from "./src/components/cluster/cluster-data-access";
import {
BlinkContainer,
type BaseBlinkLayoutProps,
type BlinkContainerProps,
} from '@dialectlabs/blinks-core';
const queryClient = new QueryClient();
export default function App() {
const colorScheme = useColorScheme();
const { LightTheme, DarkTheme } = adaptNavigationTheme({
reactNavigationLight: NavigationDefaultTheme,
reactNavigationDark: NavigationDarkTheme,
});
const CombinedDefaultTheme = {
...MD3LightTheme,
...LightTheme,
colors: {
...MD3LightTheme.colors,
...LightTheme.colors,
},
};
const CombinedDarkTheme = {
...MD3DarkTheme,
...DarkTheme,
colors: {
...MD3DarkTheme.colors,
...DarkTheme.colors,
},
};
return (
<QueryClientProvider client={queryClient}>
<ClusterProvider>
<ConnectionProvider config={{ commitment: "processed" }}>
<SafeAreaView
style={[
styles.shell,
{
backgroundColor:
colorScheme === "dark"
? MD3DarkTheme.colors.background
: MD3LightTheme.colors.background,
},
]}
>
<PaperProvider
theme={
colorScheme === "dark"
? CombinedDarkTheme
: CombinedDefaultTheme
}
>
<AppNavigator />
</PaperProvider>
</SafeAreaView>
</ConnectionProvider>
</ClusterProvider>
</QueryClientProvider>
);
}
const styles = StyleSheet.create({
shell: {
flex: 1,
},
});