This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
mobile-app/src/screens/App.tsx

28 lines
803 B
TypeScript
Raw Normal View History

import 'react-native-gesture-handler';
import React, { useEffect, useRef } from 'react';
2021-04-04 09:11:15 +00:00
import { ApolloProvider } from '@apollo/client';
import RNBootSplash from 'react-native-bootsplash';
2021-04-04 09:11:15 +00:00
import { createClient } from 'libs/graphql';
import { API_URI } from 'config/api';
2021-04-04 09:11:15 +00:00
import Navigation from './Navigation';
2021-04-04 12:31:01 +00:00
import { StyleProvider } from 'native-base';
import { createTheme, variables } from '../libs/native-base';
const App = () => {
2021-04-04 12:31:01 +00:00
const theme = useRef(createTheme(variables)).current;
const client = useRef(createClient(API_URI)).current;
useEffect(() => {
RNBootSplash.hide({ fade: true });
}, []);
return (
2021-04-04 11:36:35 +00:00
<ApolloProvider client={client}>
2021-04-04 12:31:01 +00:00
<StyleProvider style={theme}>
<Navigation />
</StyleProvider>
2021-04-04 11:36:35 +00:00
</ApolloProvider>
);
};
export default App;