diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-chromium-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-chromium-linux.png index 23aaa533c..96c3aa99b 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-chromium-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-chromium-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-webkit-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-webkit-linux.png index 820f993bd..7a6472428 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-webkit-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-ColSizes-light-webkit-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-chromium-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-chromium-linux.png index 4b45c0d54..a26dc1d7b 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-chromium-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-chromium-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-webkit-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-webkit-linux.png index 253fbf57f..547996ee1 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-webkit-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-Default-light-webkit-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-chromium-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-chromium-linux.png index ca4aa6202..9c9782cdc 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-chromium-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-chromium-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-webkit-linux.png b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-webkit-linux.png index a9d3a559e..682964853 100644 Binary files a/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-webkit-linux.png and b/src/blocks/ExtendedFeatures/__snapshots__/ExtendedFeatures.visual.test.tsx-snapshots/ExtendedFeatures-render-stories-WithLabel-light-webkit-linux.png differ diff --git a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx index 2dc5aa18b..5eac856f6 100644 --- a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx +++ b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx @@ -1,13 +1,12 @@ import {Meta, StoryFn} from '@storybook/react'; -import {transformOptionalTitle, yfmTransform} from '../../../../.storybook/utils'; -import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor'; +import {blockTransform} from '../../../../.storybook/utils'; import { ExtendedFeaturesBlockModel, ExtendedFeaturesItem, ExtendedFeaturesProps, } from '../../../models'; -import ExtendedFeatures from '../ExtendedFeatures'; +import ExtendedFeatures, {ExtendedFeaturesBlock} from '../ExtendedFeatures'; import data from './data.json'; @@ -23,54 +22,39 @@ export default { }, } as Meta; -const DefaultTemplate: StoryFn = (args) => ( - -); - -const extendedFeaturesItems = (items: ExtendedFeaturesItem[]) => { - return items.map((item) => ({ - ...item, - title: transformOptionalTitle(item.title), - list: item.list?.map((listItem) => ({ - ...listItem, - title: transformOptionalTitle(listItem.title), - text: listItem?.text && yfmTransform(listItem.text), - })), - text: item.text && yfmTransform(item.text), - additionalInfo: item.additionalInfo && yfmTransform(item.additionalInfo), - })); +const DefaultTemplate: StoryFn = (args) => { + const transformedArgs = blockTransform(args) as ExtendedFeaturesProps; + return ( +
+ +
+ ); }; -const ColSizesTemplate: StoryFn = (args) => ( - -); +const ColSizesTemplate: StoryFn = (args) => { + const transformedArgsFour = blockTransform({ + ...args, + ...data.colSizes.four, + }) as ExtendedFeaturesProps; + + const transformedArgsThree = blockTransform({ + ...args, + ...data.colSizes.three, + }) as ExtendedFeaturesProps; + + const transformedArgsTwo = blockTransform({ + ...args, + ...data.colSizes.two, + }) as ExtendedFeaturesProps; + + return ( +
+ + + +
+ ); +}; export const Default = DefaultTemplate.bind({}); export const WithLabel = DefaultTemplate.bind({}); @@ -78,17 +62,15 @@ export const ColSizes = ColSizesTemplate.bind({}); const DefaultArgs = { ...data.default.content, - title: transformOptionalTitle(data.default.content.title), - description: yfmTransform(data.default.content.description), - items: extendedFeaturesItems(data.default.content.items as ExtendedFeaturesItem[]), + items: data.default.content.items, }; Default.args = {...DefaultArgs} as ExtendedFeaturesProps; WithLabel.args = { ...DefaultArgs, - items: extendedFeaturesItems(data.withLabel.content.items as ExtendedFeaturesItem[]), + items: data.withLabel.content.items as ExtendedFeaturesItem[], } as ExtendedFeaturesProps; ColSizes.args = { ...data.default.content, - items: extendedFeaturesItems(data.default.content.items as ExtendedFeaturesItem[]), + items: data.default.content.items as ExtendedFeaturesItem[], } as ExtendedFeaturesProps;