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,25 +1,13 @@
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import styled from '@emotion/styled';
import { Meta, StoryObj } from '@storybook/react';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { EmailInputDisplay } from '../EmailInputDisplay';
const meta: Meta = {
title: 'Modules/People/EmailInputDisplay',
title: 'UI/Input/EmailInputDisplay',
component: EmailInputDisplay,
decorators: [
(Story) => (
<StyledTestEmailContainer>
<BrowserRouter>
<Story />
</BrowserRouter>
</StyledTestEmailContainer>
),
ComponentDecorator,
],
decorators: [ComponentWithRouterDecorator],
args: {
value: 'mustajab.ikram@google.com',
},
@ -29,9 +17,4 @@ export default meta;
type Story = StoryObj<typeof EmailInputDisplay>;
const StyledTestEmailContainer = styled.div`
align-items: center;
color: ${({ theme }) => theme.font.color.primary};
display: flex;
`;
export const Default: Story = {};

View File

@ -1,25 +1,13 @@
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import styled from '@emotion/styled';
import { Meta, StoryObj } from '@storybook/react';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { PhoneInputDisplay } from '../PhoneInputDisplay'; // Adjust the import path as needed
const meta: Meta = {
title: 'Modules/People/PhoneInputDisplay',
title: 'UI/Input/PhoneInputDisplay',
component: PhoneInputDisplay,
decorators: [
(Story) => (
<StyledTestPhoneContainer>
<BrowserRouter>
<Story />
</BrowserRouter>
</StyledTestPhoneContainer>
),
ComponentDecorator,
],
decorators: [ComponentWithRouterDecorator],
args: {
value: '+33788901234',
},
@ -29,10 +17,4 @@ export default meta;
type Story = StoryObj<typeof PhoneInputDisplay>;
const StyledTestPhoneContainer = styled.div`
align-items: center;
color: ${({ theme }) => theme.font.color.primary};
display: flex;
`;
export const Default: Story = {};