Refactor Layout (#322)

* Refactor Layout

* Fix storybook

* Fixing tests by forcing msw version before regression
This commit is contained in:
Charles Bochet
2023-06-17 21:24:15 +02:00
committed by GitHub
parent 5ae5f28dcb
commit 49462c69a2
38 changed files with 325 additions and 451 deletions

View File

@ -3,17 +3,27 @@ import { MemoryRouter } from 'react-router-dom';
import { ApolloProvider } from '@apollo/client';
import { RecoilRoot } from 'recoil';
import { DefaultLayout } from '@/ui/layout/DefaultLayout';
import { AuthProvider } from '~/providers/AuthProvider';
import { ComponentStorybookLayout } from './ComponentStorybookLayout';
import { FullHeightStorybookLayout } from './FullHeightStorybookLayout';
import { mockedClient } from './mockedClient';
export function getRenderWrapperForPage(children: React.ReactElement) {
export function getRenderWrapperForPage(
children: React.ReactElement,
currentPath: string,
) {
return function render() {
return (
<RecoilRoot>
<ApolloProvider client={mockedClient}>
<MemoryRouter>
<FullHeightStorybookLayout>{children}</FullHeightStorybookLayout>
<MemoryRouter initialEntries={[currentPath]}>
<FullHeightStorybookLayout>
<AuthProvider>
<DefaultLayout>{children}</DefaultLayout>
</AuthProvider>
</FullHeightStorybookLayout>
</MemoryRouter>
</ApolloProvider>
</RecoilRoot>