Skip to content

Commit

Permalink
a11y(WriteBar): add onClick to add interactivity (#7376)
Browse files Browse the repository at this point in the history
Добавил прокидывание noop колбэка в onClick для кнопок
  • Loading branch information
EldarMuhamethanov authored and actions-user committed Aug 14, 2024
1 parent ba82eb9 commit b45785e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vkui/src/components/WriteBar/WriteBar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import { Icon28SmileOutline } from '@vkontakte/icons';
import { noop } from '@vkontakte/vkjs';
import { CanvasFullLayout, DisableCartesianParam } from '../../storybook/constants';
import { WriteBarIcon } from '../WriteBarIcon/WriteBarIcon';
import { WriteBar, WriteBarProps } from './WriteBar';
Expand All @@ -18,13 +19,13 @@ type Story = StoryObj<WriteBarProps>;

export const Playground: Story = {
args: {
before: <WriteBarIcon count={10} mode="attach" />,
before: <WriteBarIcon count={10} mode="attach" onClick={noop} />,
placeholder: 'Сообщение',
inlineAfter: (
<WriteBarIcon label="Смайлы и стикеры">
<WriteBarIcon label="Смайлы и стикеры" onClick={noop}>
<Icon28SmileOutline />
</WriteBarIcon>
),
after: <WriteBarIcon mode="send" />,
after: <WriteBarIcon mode="send" onClick={noop} />,
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { noop } from '@vkontakte/vkjs';
import { CanvasFullLayout, DisableCartesianParam } from '../../storybook/constants';
import { WriteBarIcon, WriteBarIconProps } from './WriteBarIcon';

Expand All @@ -15,5 +16,6 @@ type Story = StoryObj<WriteBarIconProps>;
export const Playground: Story = {
args: {
mode: 'attach',
onClick: noop,
},
};

0 comments on commit b45785e

Please sign in to comment.