Skip to content

Commit

Permalink
EPMRPP-92233 || code review fixes - 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim73i committed Jul 23, 2024
1 parent 649172c commit 93b0420
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/components/datePicker/datePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@ const meta: Meta<typeof DatePicker> = {
layout: 'centered',
},
tags: ['autodocs'],
};

export default meta;

type Story = StoryObj<typeof DatePicker>;

export const Default: Story = {
args: {},
};

export const Single: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [date, setDate] = useState<Date | undefined>(undefined);
registerDatePickerLocale('ru', ru);
return (
<>
Single DatePicker:
<DatePicker {...args} value={date} onChange={setDate} language={'ru'} />
<DatePicker {...args} value={date} onChange={setDate} />
</>
);
},
};

export default meta;

type Story = StoryObj<typeof DatePicker>;

export const Default: Story = {
args: {},
};

export const Range: Story = {
render: (args) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
Expand Down Expand Up @@ -63,6 +65,15 @@ export const Range: Story = {
},
};

export const WithLocale: Story = {
render: (args) => {
registerDatePickerLocale('ru', ru);
return (

Check failure on line 71 in src/components/datePicker/datePicker.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `(⏎······<DatePicker·{...args}·language={'ru'}·/>⏎····)` with `<DatePicker·{...args}·language={'ru'}·/>`
<DatePicker {...args} language={'ru'} />
);
},
};

export const Disabled: Story = {
args: {
disabled: true,
Expand Down

0 comments on commit 93b0420

Please sign in to comment.