Lucas/t 223 i can add comments to companies or people using the right (#181)
* wip * Implemented comment input text component * Improved behavior
This commit is contained in:
21
front/src/testing/ComponentStorybookLayout.tsx
Normal file
21
front/src/testing/ComponentStorybookLayout.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
const StyledLayout = styled.div`
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
|
||||
padding: 20px;
|
||||
background: ${(props) => props.theme.primaryBackground};
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 0px 2px;
|
||||
`;
|
||||
|
||||
type OwnProps = {
|
||||
children: JSX.Element;
|
||||
};
|
||||
|
||||
export function ComponentStorybookLayout({ children }: OwnProps) {
|
||||
return <StyledLayout>{children}</StyledLayout>;
|
||||
}
|
||||
39
front/src/testing/renderWrappers.tsx
Normal file
39
front/src/testing/renderWrappers.tsx
Normal file
@ -0,0 +1,39 @@
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { FullHeightStorybookLayout } from './FullHeightStorybookLayout';
|
||||
import { ThemeProvider } from '@emotion/react';
|
||||
import { ApolloProvider } from '@apollo/client';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
import { mockedClient } from './mockedClient';
|
||||
import { lightTheme } from '../layout/styles/themes';
|
||||
import React from 'react';
|
||||
import { ComponentStorybookLayout } from './ComponentStorybookLayout';
|
||||
|
||||
export function getRenderWrapperForPage(children: React.ReactElement) {
|
||||
return function render() {
|
||||
return (
|
||||
<RecoilRoot>
|
||||
<ApolloProvider client={mockedClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<MemoryRouter>
|
||||
<FullHeightStorybookLayout>{children}</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
</ThemeProvider>
|
||||
</ApolloProvider>
|
||||
</RecoilRoot>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export function getRenderWrapperForComponent(children: React.ReactElement) {
|
||||
return function render() {
|
||||
return (
|
||||
<RecoilRoot>
|
||||
<ApolloProvider client={mockedClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<ComponentStorybookLayout>{children}</ComponentStorybookLayout>
|
||||
</ThemeProvider>
|
||||
</ApolloProvider>
|
||||
</RecoilRoot>
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user