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

42 lines
1.1 KiB
TypeScript
Raw Normal View History

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