Files
cnapp/src/App.tsx
T
nikolark 7a1fb19f56 Misc typing improvements++
Turned on compilerOptions.strict in tsconfig.json
and and did a bunch of ad hoc changes. Typed most of the implicit anys

 - Remove redux 4 to 5 migration
 - Stop prop drilling user state
 - Add more data types
 - Start typing redux state
 - Started using redux hooks in Dusken.tsx in favor of the connect HOC
2024-07-07 21:52:48 +02:00

46 lines
1.8 KiB
TypeScript

import { ApolloClient, HttpLink, InMemoryCache, ApolloProvider } from '@apollo/client';
import { StripeProvider } from '@stripe/stripe-react-native';
import Constants from 'expo-constants';
import React from 'react';
import { LogBox } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import Dusken from './Dusken';
import { useDeepLinking } from './hooks';
import { store, persistor } from './reduxStore';
import { loadTheme } from './theme';
const apolloClient = new ApolloClient({
link: new HttpLink({ uri: `${process.env.EXPO_PUBLIC_DUSKEN_API_URL}/api/graphql/` }),
cache: new InMemoryCache(),
});
// FIXME: Replace unmaintained native-base with https://wix.github.io/react-native-ui-lib/ which produces this warning
LogBox.ignoreLogs(['In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.']);
loadTheme();
export default function App() {
useDeepLinking();
return (
<GestureHandlerRootView>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ApolloProvider client={apolloClient}>
{/* FIXME: Read urlScheme and merchantIdentifier from .Config */}
<StripeProvider
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY || ''}
urlScheme={Constants.expoConfig?.scheme as string}
merchantIdentifier="merchant.no.neuf.chateau" // https://developer.apple.com/account/resources/identifiers/list/merchant
>
<Dusken />
</StripeProvider>
</ApolloProvider>
</PersistGate>
</Provider>
</GestureHandlerRootView>
);
}
/** YOLO */