1// eslint-disable-next-line react/no-multi-comp
2
3import React, { useEffect } from 'react';
4import { Root, Routes } from 'react-static';
5import { ThemeProvider } from 'styled-components';
6
7import constants from './constants';
8import { GlobalStyle } from './styles/global';
9import * as theme from './styles/theme';
10import Analytics from './google-analytics';
11import { initGoogleTagManager } from './google-tag-manager';
12import { Loading } from './components/loading';
13
14const App = () => {
15 useEffect(() => {
16 initGoogleTagManager();
17 }, []);
18
19 return (
20 <Root>
21 <ThemeProvider theme={theme}>
22 <GlobalStyle />
23 <React.Suspense fallback={<Loading />}>
24 <Analytics id={constants.googleAnalyticsId}>
25 <Routes />
26 </Analytics>
27 </React.Suspense>
28 </ThemeProvider>
29 </Root>
30 );
31};
32
33export default App;