|
6 | 6 | import "@walletconnect/react-native-compat"; |
7 | 7 | import { Stack } from "expo-router"; |
8 | 8 | import { StatusBar } from "expo-status-bar"; |
| 9 | +import { GestureHandlerRootView } from "react-native-gesture-handler"; |
9 | 10 | import "react-native-reanimated"; |
10 | 11 | import Toast from "react-native-toast-message"; |
11 | 12 | import { WagmiProvider } from "wagmi"; |
@@ -62,73 +63,76 @@ export default Sentry.wrap(function RootLayout() { |
62 | 63 | }); |
63 | 64 |
|
64 | 65 | return ( |
65 | | - <AppKitProvider instance={appKit}> |
66 | | - <WagmiProvider config={wagmiAdapter.wagmiConfig}> |
67 | | - <QueryClientProvider client={queryClient}> |
68 | | - <ThemeProvider |
69 | | - value={colorScheme === "dark" ? DarkTheme : DefaultTheme} |
70 | | - > |
71 | | - <POSProvider posClient={posClient} isInitialized={isInitialized}> |
72 | | - <Stack |
73 | | - screenOptions={({ route }) => { |
74 | | - const centerTitle = |
75 | | - route.name === "index" || route.name === "payment-success"; |
76 | | - const isPaymentSuccess = route.name === "payment-success"; |
77 | | - const headerBackgroundColor = isPaymentSuccess |
78 | | - ? Theme["text-success"] |
79 | | - : Theme["bg-primary"]; |
| 66 | + <GestureHandlerRootView> |
| 67 | + <AppKitProvider instance={appKit}> |
| 68 | + <WagmiProvider config={wagmiAdapter.wagmiConfig}> |
| 69 | + <QueryClientProvider client={queryClient}> |
| 70 | + <ThemeProvider |
| 71 | + value={colorScheme === "dark" ? DarkTheme : DefaultTheme} |
| 72 | + > |
| 73 | + <POSProvider posClient={posClient} isInitialized={isInitialized}> |
| 74 | + <Stack |
| 75 | + screenOptions={({ route }) => { |
| 76 | + const centerTitle = |
| 77 | + route.name === "index" || |
| 78 | + route.name === "payment-success"; |
| 79 | + const isPaymentSuccess = route.name === "payment-success"; |
| 80 | + const headerBackgroundColor = isPaymentSuccess |
| 81 | + ? Theme["text-success"] |
| 82 | + : Theme["bg-primary"]; |
80 | 83 |
|
81 | | - const headerTintColor = isPaymentSuccess |
82 | | - ? Theme["text-invert"] |
83 | | - : Theme["text-primary"]; |
| 84 | + const headerTintColor = isPaymentSuccess |
| 85 | + ? Theme["text-invert"] |
| 86 | + : Theme["text-primary"]; |
84 | 87 |
|
85 | | - return { |
86 | | - headerTitle: centerTitle ? HeaderImage : "", |
87 | | - headerRight: !centerTitle |
88 | | - ? () => ( |
89 | | - <HeaderImage padding tintColor={headerTintColor} /> |
90 | | - ) |
91 | | - : undefined, |
92 | | - headerShadowVisible: false, |
93 | | - headerTintColor, |
94 | | - headerBackButtonDisplayMode: "minimal", |
95 | | - headerTitleAlign: "center", |
96 | | - headerStyle: { |
97 | | - backgroundColor: headerBackgroundColor, |
98 | | - }, |
99 | | - contentStyle: { |
100 | | - backgroundColor: Theme["bg-primary"], |
101 | | - paddingBottom: bottom, |
102 | | - }, |
103 | | - }; |
104 | | - }} |
105 | | - > |
106 | | - <Stack.Screen name="index" /> |
107 | | - <Stack.Screen |
108 | | - name="settings" |
109 | | - options={{ |
110 | | - title: "", |
| 88 | + return { |
| 89 | + headerTitle: centerTitle ? HeaderImage : "", |
| 90 | + headerRight: !centerTitle |
| 91 | + ? () => ( |
| 92 | + <HeaderImage padding tintColor={headerTintColor} /> |
| 93 | + ) |
| 94 | + : undefined, |
| 95 | + headerShadowVisible: false, |
| 96 | + headerTintColor, |
| 97 | + headerBackButtonDisplayMode: "minimal", |
| 98 | + headerTitleAlign: "center", |
| 99 | + headerStyle: { |
| 100 | + backgroundColor: headerBackgroundColor, |
| 101 | + }, |
| 102 | + contentStyle: { |
| 103 | + backgroundColor: Theme["bg-primary"], |
| 104 | + paddingBottom: bottom, |
| 105 | + }, |
| 106 | + }; |
111 | 107 | }} |
112 | | - /> |
113 | | - <Stack.Screen name="amount" /> |
114 | | - <Stack.Screen name="payment-method" /> |
115 | | - <Stack.Screen name="payment-token" /> |
116 | | - <Stack.Screen name="payment-network" /> |
117 | | - <Stack.Screen name="scan" /> |
118 | | - <Stack.Screen |
119 | | - name="payment-success" |
120 | | - options={{ |
121 | | - headerBackVisible: false, |
122 | | - }} |
123 | | - /> |
124 | | - </Stack> |
125 | | - <StatusBar style="auto" /> |
126 | | - <AppKit /> |
127 | | - </POSProvider> |
128 | | - <Toast /> |
129 | | - </ThemeProvider> |
130 | | - </QueryClientProvider> |
131 | | - </WagmiProvider> |
132 | | - </AppKitProvider> |
| 108 | + > |
| 109 | + <Stack.Screen name="index" /> |
| 110 | + <Stack.Screen |
| 111 | + name="settings" |
| 112 | + options={{ |
| 113 | + title: "", |
| 114 | + }} |
| 115 | + /> |
| 116 | + <Stack.Screen name="amount" /> |
| 117 | + <Stack.Screen name="payment-method" /> |
| 118 | + <Stack.Screen name="payment-token" /> |
| 119 | + <Stack.Screen name="payment-network" /> |
| 120 | + <Stack.Screen name="scan" /> |
| 121 | + <Stack.Screen |
| 122 | + name="payment-success" |
| 123 | + options={{ |
| 124 | + headerBackVisible: false, |
| 125 | + }} |
| 126 | + /> |
| 127 | + </Stack> |
| 128 | + <StatusBar style="auto" /> |
| 129 | + <AppKit /> |
| 130 | + </POSProvider> |
| 131 | + <Toast /> |
| 132 | + </ThemeProvider> |
| 133 | + </QueryClientProvider> |
| 134 | + </WagmiProvider> |
| 135 | + </AppKitProvider> |
| 136 | + </GestureHandlerRootView> |
133 | 137 | ); |
134 | 138 | }); |
0 commit comments