Files
inji-wallet/App.tsx
Paolo Miguel de Leon 5355ba0a35 feat: add localization
2022-04-25 15:38:58 +08:00

27 lines
828 B
TypeScript

import React, { useContext } from 'react';
import AppLoading from 'expo-app-loading';
import { AppLayout } from './screens/AppLayout';
import { useFont } from './shared/hooks/useFont';
import { GlobalContextProvider } from './components/GlobalContextProvider';
import { GlobalContext } from './shared/GlobalContext';
import { useSelector } from '@xstate/react';
import { selectIsReady } from './machines/app';
import './i18n';
const AppInitialization: React.FC = () => {
const { appService } = useContext(GlobalContext);
const hasFontsLoaded = useFont();
const isReady = useSelector(appService, selectIsReady);
return isReady && hasFontsLoaded ? <AppLayout /> : <AppLoading />;
};
export default function App() {
return (
<GlobalContextProvider>
<AppInitialization />
</GlobalContextProvider>
);
}