Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment provider container to app #513

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import CirrusFavicon from './components/common/CirrusFavicon';
import { CssBaseline } from '@mui/material';
import { useRecoilValue } from 'recoil';
import * as Sentry from '@sentry/react';
import { RelayEnvironmentProvider } from 'react-relay';
import environment from '../src/createRelayEnvironment';

declare module '@mui/styles/defaultTheme' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand All @@ -19,14 +21,16 @@ export default function App(): JSX.Element {
const theme = React.useMemo(() => createTheme(themeOptions), [themeOptions]);

return (
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<CirrusFavicon />
<CssBaseline />
<Sentry.ErrorBoundary>
<Routes />
</Sentry.ErrorBoundary>
</ThemeProvider>
</StyledEngineProvider>
<RelayEnvironmentProvider environment={environment}>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<CirrusFavicon />
<CssBaseline />
<Sentry.ErrorBoundary>
<Routes />
</Sentry.ErrorBoundary>
</ThemeProvider>
</StyledEngineProvider>
</RelayEnvironmentProvider>
);
}