Rework tel input (#1316)

* Rework tel input

* Fix lint
This commit is contained in:
Charles Bochet
2023-08-25 20:54:00 +02:00
committed by GitHub
parent 4f7e1fb60e
commit 67cf6cd7e2
10 changed files with 127 additions and 226 deletions

View File

@ -1,35 +1,13 @@
import { BrowserRouter } from 'react-router-dom';
import styled from '@emotion/styled';
import type { Meta, StoryObj } from '@storybook/react';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { PersonChip } from '../PersonChip';
const StyledTestCellContainer = styled.div`
align-items: center;
background: ${({ theme }) => theme.background.primary};
display: flex;
height: fit-content;
justify-content: space-between;
max-width: 250px;
min-width: 250px;
overflow: hidden;
`;
const meta: Meta<typeof PersonChip> = {
title: 'Modules/People/PersonChip',
component: PersonChip,
decorators: [
(Story) => (
<StyledTestCellContainer>
<BrowserRouter>
<Story />
</BrowserRouter>
</StyledTestCellContainer>
),
ComponentDecorator,
],
decorators: [ComponentWithRouterDecorator],
};
export default meta;

View File

@ -1,27 +0,0 @@
import { BrowserRouter } from 'react-router-dom';
import type { Meta, StoryObj } from '@storybook/react';
import { PhoneCellEdit } from '@/ui/table/editable-cell/type/components/PhoneCellEdit';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
const meta: Meta<typeof PhoneCellEdit> = {
title: 'Modules/People/EditableFields/PhoneEditableField',
component: PhoneCellEdit,
decorators: [
(Story) => (
<BrowserRouter>
<Story />
</BrowserRouter>
),
ComponentDecorator,
],
args: {
value: '+33714446494',
autoFocus: true,
},
};
export default meta;
type Story = StoryObj<typeof PhoneCellEdit>;
export const Default: Story = {};