diff --git a/src/blocks/Share/Share.tsx b/src/blocks/Share/Share.tsx index b1cb269ab..0c17d7dd8 100644 --- a/src/blocks/Share/Share.tsx +++ b/src/blocks/Share/Share.tsx @@ -69,9 +69,7 @@ const Share = ({items, title}: ShareBlockProps) => { className={b('item', {type: type.toLowerCase()})} onClick={handleButtonClick} title={urlTitle} - extraProps={{ - 'aria-label': buttonLabel, - }} + aria-label={buttonLabel} > {icon && } diff --git a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-chromium-linux.png b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-chromium-linux.png index d2acbeed2..3b91f3d52 100644 Binary files a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-chromium-linux.png and b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-chromium-linux.png differ diff --git a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-webkit-linux.png b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-webkit-linux.png index 49ef73f77..135334596 100644 Binary files a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-webkit-linux.png and b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-CustomTitle-light-webkit-linux.png differ diff --git a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-chromium-linux.png b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-chromium-linux.png index 0defb2a3c..5f1cfc1bc 100644 Binary files a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-chromium-linux.png and b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-chromium-linux.png differ diff --git a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-webkit-linux.png b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-webkit-linux.png index ba174ec82..5926f0fb3 100644 Binary files a/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-webkit-linux.png and b/src/blocks/Share/__snapshots__/Share.visual.test.tsx-snapshots/Share-render-stories-Default-light-webkit-linux.png differ diff --git a/src/blocks/Share/__stories__/Share.mdx b/src/blocks/Share/__stories__/Share.mdx index 954b02ae2..7a9da3621 100644 --- a/src/blocks/Share/__stories__/Share.mdx +++ b/src/blocks/Share/__stories__/Share.mdx @@ -8,15 +8,14 @@ import * as ShareStories from './Share.stories.tsx'; ## Parameters -`type: share-block`; - -`title?: string` — Title - -`items?: []` - Share icons +`type: share-block` +`items: PCShareSocialNetwork[]` - Share icons +- `vk` - `telegram` -- `facebook` - `twitter` -- `vk` - +- `facebook` +- `linkedin` +`title?: string` — Title + diff --git a/src/blocks/Share/__stories__/Share.stories.tsx b/src/blocks/Share/__stories__/Share.stories.tsx index bcdcb163a..e09861e91 100644 --- a/src/blocks/Share/__stories__/Share.stories.tsx +++ b/src/blocks/Share/__stories__/Share.stories.tsx @@ -1,8 +1,7 @@ -import {Lang as UIKitLang, configure as uikitConfigure} from '@gravity-ui/uikit'; import {Meta, StoryFn} from '@storybook/react'; -import {PageConstructor} from '../../../containers/PageConstructor'; -import {ShareBLockModel, ShareBlockProps} from '../../../models'; +import {blockTransform} from '../../../../.storybook/utils'; +import {PCShareSocialNetwork, ShareBLockModel, ShareBlockProps} from '../../../models'; import Share from '../Share'; import data from './data.json'; @@ -10,16 +9,31 @@ import data from './data.json'; export default { component: Share, title: 'Blocks/Share', + argTypes: { + items: { + control: {type: 'check'}, + options: Object.values(PCShareSocialNetwork), + }, + }, } as Meta; -uikitConfigure({lang: UIKitLang.En}); - const DefaultTemplate: StoryFn = (args) => ( - + ); export const Default = DefaultTemplate.bind({}); export const CustomTitle = DefaultTemplate.bind({}); -Default.args = data.default.content as ShareBlockProps; -CustomTitle.args = data.customTitle.content as ShareBlockProps; +Default.args = data.default.content as ShareBLockModel; +Default.parameters = { + controls: { + include: ['title', 'items'], + }, +}; + +CustomTitle.args = data.customTitle.content as ShareBLockModel; +CustomTitle.parameters = { + controls: { + include: ['title', 'items'], + }, +};