Refactor Layout (#322)
* Refactor Layout * Fix storybook * Fixing tests by forcing msw version before regression
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user