App.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { ApolloProvider } from '@apollo/client'
  2. import React from 'react'
  3. import { BrowserRouter } from 'react-router-dom'
  4. import { createApolloClient } from '@/api'
  5. import { GlobalStyle } from '@/shared/components'
  6. import { routingTransitions } from '@/styles/routingTransitions'
  7. import { MainLayout } from './MainLayout'
  8. import { AssetsManager, DialogProvider, OverlayManagerProvider, Snackbars, StorageProvidersProvider } from './providers'
  9. export const App = () => {
  10. // create client on render so the mocking setup is done if needed
  11. // App doesn't accept props and doesn't contain state so should never rerender
  12. const apolloClient = createApolloClient()
  13. return (
  14. <>
  15. <GlobalStyle additionalStyles={[routingTransitions]} />
  16. <ApolloProvider client={apolloClient}>
  17. <BrowserRouter>
  18. <OverlayManagerProvider>
  19. <StorageProvidersProvider>
  20. <DialogProvider>
  21. <MainLayout />
  22. <Snackbars />
  23. <AssetsManager />
  24. </DialogProvider>
  25. </StorageProvidersProvider>
  26. </OverlayManagerProvider>
  27. </BrowserRouter>
  28. </ApolloProvider>
  29. </>
  30. )
  31. }