From 0cd344eea58c60bd360dcfd524f12f137146d07b Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 26 Feb 2024 13:51:50 +0300 Subject: [PATCH 1/6] feat: add story for form with content list --- .../__stories__/ExtendedFeatures.stories.tsx | 6 +++ src/blocks/Form/__stories__/Form.stories.tsx | 41 +++++++++++++++++-- src/blocks/Form/__stories__/data.json | 28 ++++++++++++- src/models/constructor-items/blocks.ts | 1 + 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx index d48b980e3..e95004656 100644 --- a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx +++ b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx @@ -32,6 +32,12 @@ const DefaultTemplate: StoryFn = (args) => ( const extendedFeaturesItems = (items: ExtendedFeaturesItem[]) => { return items.map((item) => ({ ...item, + list: + item.list && + item.list.map((listItem) => ({ + ...listItem, + text: listItem?.text && yfmTransform(listItem.text), + })), text: item.text && yfmTransform(item.text), additionalInfo: item.additionalInfo && yfmTransform(item.additionalInfo), })); diff --git a/src/blocks/Form/__stories__/Form.stories.tsx b/src/blocks/Form/__stories__/Form.stories.tsx index 2173a9a39..07fa0db46 100644 --- a/src/blocks/Form/__stories__/Form.stories.tsx +++ b/src/blocks/Form/__stories__/Form.stories.tsx @@ -5,11 +5,23 @@ import {v4 as uuidv4} from 'uuid'; import {yfmTransform} from '../../../../.storybook/utils'; import {PageConstructor} from '../../../containers/PageConstructor'; -import {FormBlockDirection, FormBlockModel, isHubspotDataForm} from '../../../models'; +import { + ContentItemProps, + FormBlockDirection, + FormBlockModel, + isHubspotDataForm, +} from '../../../models'; import FormBlock from '../Form'; import data from './data.json'; +const transformedContentList = data.list.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + export default { title: 'Blocks/Form', component: FormBlock, @@ -36,7 +48,26 @@ const __getFormData = (formData: FormBlockModel['formData']) => { const DefaultTemplate: StoryFn = (args) => ( +); + +const WithContentListTemplate: StoryFn = (args) => ( + ); @@ -54,7 +85,10 @@ const ContentDirectionTemplate: StoryFn = (args) => ( { ...args, direction: FormBlockDirection.ContentForm, - textContent: {...args.textContent, title: 'ContentForm'}, + textContent: { + ...args.textContent, + title: 'ContentForm', + }, formData: __getFormData(args.formData), }, { @@ -85,6 +119,7 @@ export const WithBackgroundColor = ContentDirectionTemplate.bind({}); export const WithBackgroundImage = ContentDirectionTemplate.bind({}); export const DarkTheme = ContentDirectionTemplate.bind({}); export const FormData = FormDataTemplate.bind({}); +export const WithContentList = WithContentListTemplate.bind({}); WithBackgroundColor.args = data.withBackground; diff --git a/src/blocks/Form/__stories__/data.json b/src/blocks/Form/__stories__/data.json index 939a276f9..038bcf247 100644 --- a/src/blocks/Form/__stories__/data.json +++ b/src/blocks/Form/__stories__/data.json @@ -49,5 +49,31 @@ "customFormSection": "cloud" } } - } + }, + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ] } diff --git a/src/models/constructor-items/blocks.ts b/src/models/constructor-items/blocks.ts index 0449dbf4f..72cbbf1fa 100644 --- a/src/models/constructor-items/blocks.ts +++ b/src/models/constructor-items/blocks.ts @@ -372,6 +372,7 @@ export interface ContentItemProps { export interface ContentListProps { list: ContentItemProps[]; size: ContentSize; + theme?: ContentTheme; } export interface ContentBlockProps { From 6af119768bdf2e4f8fb91c7fbd8b666e40c17f3b Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 26 Feb 2024 16:14:57 +0300 Subject: [PATCH 2/6] feat: add story with content list to Info and Questions --- src/blocks/Info/Info.tsx | 2 ++ src/blocks/Info/__stories__/Info.stories.tsx | 26 ++++++++++++++++- src/blocks/Info/__stories__/data.json | 26 +++++++++++++++++ src/blocks/Questions/Questions.tsx | 3 +- .../__stories__/Questions.stories.tsx | 2 ++ src/blocks/Questions/__stories__/data.json | 28 +++++++++++++++++++ 6 files changed, 85 insertions(+), 2 deletions(-) diff --git a/src/blocks/Info/Info.tsx b/src/blocks/Info/Info.tsx index f554d5d72..08980f99d 100644 --- a/src/blocks/Info/Info.tsx +++ b/src/blocks/Info/Info.tsx @@ -53,6 +53,7 @@ export const InfoBlock = (props: InfoBlockProps) => { title={title || leftContent?.title} text={leftContent?.text} links={leftContent?.links} + list={leftContent?.list} buttons={leftButtons} additionalInfo={leftContent?.additionalInfo} {...commonProps} @@ -63,6 +64,7 @@ export const InfoBlock = (props: InfoBlockProps) => { title={sectionsTitle || rightContent?.title} text={rightContent?.text} links={rightLinks} + list={rightContent?.list} buttons={rightContent?.buttons} additionalInfo={rightContent?.additionalInfo} {...commonProps} diff --git a/src/blocks/Info/__stories__/Info.stories.tsx b/src/blocks/Info/__stories__/Info.stories.tsx index 22da8c443..a1753e387 100644 --- a/src/blocks/Info/__stories__/Info.stories.tsx +++ b/src/blocks/Info/__stories__/Info.stories.tsx @@ -4,11 +4,18 @@ import {Meta, StoryFn} from '@storybook/react'; import {yfmTransform} from '../../../../.storybook/utils'; import {PageConstructor} from '../../../containers/PageConstructor/PageConstructor'; -import {InfoBlockModel, InfoBlockProps} from '../../../models'; +import {ContentItemProps, InfoBlockModel, InfoBlockProps} from '../../../models'; import Info from '../Info'; import data from './data.json'; +const transformedContentList = data.common.list.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + export default { title: 'Blocks/Info', component: Info, @@ -19,6 +26,7 @@ const DefaultTemplate: StoryFn = (args) => ( ); export const Default = DefaultTemplate.bind({}); +export const WithContentList = DefaultTemplate.bind({}); export const LightTheme = DefaultTemplate.bind({}); const transformedText = yfmTransform(data.common.text); @@ -50,3 +58,19 @@ LightTheme.args = { text: transformedText, }, } as InfoBlockProps; + +WithContentList.args = { + ...data.light.content, + leftContent: { + ...data.dark.content.leftContent, + title: data.common.title, + text: transformedText, + list: transformedContentList, + }, + rightContent: { + title: data.common.title, + links: data.common.links, + text: transformedText, + list: transformedContentList, + }, +} as InfoBlockProps; diff --git a/src/blocks/Info/__stories__/data.json b/src/blocks/Info/__stories__/data.json index d29d78316..eed36b9a5 100644 --- a/src/blocks/Info/__stories__/data.json +++ b/src/blocks/Info/__stories__/data.json @@ -15,6 +15,32 @@ "arrow": true } ], + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ], "title": "Lorem ipsum dolor sit amet" }, "light": { diff --git a/src/blocks/Questions/Questions.tsx b/src/blocks/Questions/Questions.tsx index 5893261e9..3a0a18bca 100644 --- a/src/blocks/Questions/Questions.tsx +++ b/src/blocks/Questions/Questions.tsx @@ -13,7 +13,7 @@ import './Questions.scss'; const b = block('QuestionsBlock'); const QuestionsBlock = (props: QuestionsProps) => { - const {title, text, additionalInfo, links, buttons, items} = props; + const {title, text, additionalInfo, links, buttons, items, list} = props; const [opened, setOpened] = useState([0]); const toggleItem = (index: number) => { @@ -38,6 +38,7 @@ const QuestionsBlock = (props: QuestionsProps) => { text={text} additionalInfo={additionalInfo} links={links} + list={list} buttons={buttons} colSizes={{all: 12, md: 12}} /> diff --git a/src/blocks/Questions/__stories__/Questions.stories.tsx b/src/blocks/Questions/__stories__/Questions.stories.tsx index 0325a6326..382f6b0a2 100644 --- a/src/blocks/Questions/__stories__/Questions.stories.tsx +++ b/src/blocks/Questions/__stories__/Questions.stories.tsx @@ -21,7 +21,9 @@ const DefaultTemplate: StoryFn = (args) => ( export const Default = DefaultTemplate.bind({}); export const TextWithListDash = DefaultTemplate.bind({}); export const TextWithListBullet = DefaultTemplate.bind({}); +export const WithContentList = DefaultTemplate.bind({}); Default.args = data.default.content as QuestionsProps; +WithContentList.args = {...data.default.content, list: data.common.list} as QuestionsProps; TextWithListDash.args = data.textWithListDash.content as QuestionsProps; TextWithListBullet.args = data.textWithListBullet.content as QuestionsProps; diff --git a/src/blocks/Questions/__stories__/data.json b/src/blocks/Questions/__stories__/data.json index 93aacb4e2..add692afd 100644 --- a/src/blocks/Questions/__stories__/data.json +++ b/src/blocks/Questions/__stories__/data.json @@ -1,4 +1,32 @@ { + "common": { + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ] + }, "default": { "content": { "type": "questions-block", From 3a27f515f0485022187e10016fed806fbc7551e0 Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 26 Feb 2024 16:32:41 +0300 Subject: [PATCH 3/6] feat: add story with content list in TabTextContent --- .../Tabs/TabsTextContent/TabsTextContent.tsx | 46 +++++++++---------- src/blocks/Tabs/__stories__/Tabs.stories.tsx | 6 +++ src/blocks/Tabs/__stories__/data.json | 23 ++++++++++ 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/blocks/Tabs/TabsTextContent/TabsTextContent.tsx b/src/blocks/Tabs/TabsTextContent/TabsTextContent.tsx index 6e4d8597d..a52dd096b 100644 --- a/src/blocks/Tabs/TabsTextContent/TabsTextContent.tsx +++ b/src/blocks/Tabs/TabsTextContent/TabsTextContent.tsx @@ -21,31 +21,29 @@ export const TabsTextContent = ({ centered, contentSize = 's', showMedia, - data, + data: {media, title, text, additionalInfo, link, links, buttons, list}, imageProps, isReverse, -}: TextContentProps) => { - const isImage = data?.media || imageProps; - return ( - -
- -
- - ); -}; +}: TextContentProps) => ( + +
+ +
+ +); export default TabsTextContent; diff --git a/src/blocks/Tabs/__stories__/Tabs.stories.tsx b/src/blocks/Tabs/__stories__/Tabs.stories.tsx index b3b7189e0..1c44d8255 100644 --- a/src/blocks/Tabs/__stories__/Tabs.stories.tsx +++ b/src/blocks/Tabs/__stories__/Tabs.stories.tsx @@ -57,6 +57,12 @@ const DefaultArgs = { items: data.default.content.items.map((item) => ({ ...item, text: yfmTransform(item.text), + list: + item.list && + item.list.map((listItem) => ({ + ...listItem, + text: yfmTransform(listItem.text), + })), additionalInfo: item.additionalInfo && yfmTransform(item.additionalInfo), caption: item.caption && yfmTransform(item.caption), })), diff --git a/src/blocks/Tabs/__stories__/data.json b/src/blocks/Tabs/__stories__/data.json index 4320d96ca..e6ad24db7 100644 --- a/src/blocks/Tabs/__stories__/data.json +++ b/src/blocks/Tabs/__stories__/data.json @@ -22,6 +22,29 @@ "url": "#" } ], + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + } + ], "media": { "light": { "image": "/story-assets/img_8-12_white.png" From 7598a44f1822843c868304177bb271b6f914ca8a Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 26 Feb 2024 16:42:24 +0300 Subject: [PATCH 4/6] feat: add story with content list in BackgroundCard --- .../BackgroundCard/BackgroundCard.tsx | 2 ++ .../__stories__/BackgroundCard.stories.tsx | 12 +++++++++- .../BackgroundCard/__stories__/data.json | 24 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/sub-blocks/BackgroundCard/BackgroundCard.tsx b/src/sub-blocks/BackgroundCard/BackgroundCard.tsx index 24deca4a2..f1e9166c0 100644 --- a/src/sub-blocks/BackgroundCard/BackgroundCard.tsx +++ b/src/sub-blocks/BackgroundCard/BackgroundCard.tsx @@ -28,6 +28,7 @@ const BackgroundCard = (props: BackgroundCardProps) => { analyticsEvents, urlTitle, controlPosition = 'content', + list, } = props; const titleId = useUniqId(); @@ -60,6 +61,7 @@ const BackgroundCard = (props: BackgroundCardProps) => { theme={cardTheme} links={areControlsInFooter ? undefined : links} buttons={areControlsInFooter ? undefined : buttons} + list={list} colSizes={{all: 12, md: 12}} /> diff --git a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx index 6a7f49222..64afd4c78 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx +++ b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx @@ -7,11 +7,18 @@ import CardLayout from '../../../blocks/CardLayout/CardLayout'; import {BlockBase} from '../../../components'; import {ConstructorRow} from '../../../containers/PageConstructor/components/ConstructorRow'; import {Grid} from '../../../grid'; -import {BackgroundCardProps, ButtonProps, LinkProps} from '../../../models'; +import {BackgroundCardProps, ButtonProps, ContentItemProps, LinkProps} from '../../../models'; import BackgroundCard from '../BackgroundCard'; import data from './data.json'; +const transformedContentList = data.common.list.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + const getPaddingBottomTitle = (padding: string) => data.paddings.title.replace('{{padding}}', padding); @@ -40,6 +47,9 @@ const DefaultTemplate: StoryFn = (args) => (
+
+ +
); diff --git a/src/sub-blocks/BackgroundCard/__stories__/data.json b/src/sub-blocks/BackgroundCard/__stories__/data.json index ec729e6a1..95e0ba877 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/data.json +++ b/src/sub-blocks/BackgroundCard/__stories__/data.json @@ -11,6 +11,30 @@ "arrow": true } ], + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum" + } + ], "buttons": [ { "text": "Button\r", From cc0edff981e9ba64d6bc50be89c415b3f18b9064 Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 26 Feb 2024 16:50:54 +0300 Subject: [PATCH 5/6] feat: add story with content list in LayoutItem --- .../__stories__/LayoutItem.stories.tsx | 11 +++++++ .../LayoutItem/__stories__/data.json | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/sub-blocks/LayoutItem/__stories__/LayoutItem.stories.tsx b/src/sub-blocks/LayoutItem/__stories__/LayoutItem.stories.tsx index 716a4dfc9..ddfdecdbf 100644 --- a/src/sub-blocks/LayoutItem/__stories__/LayoutItem.stories.tsx +++ b/src/sub-blocks/LayoutItem/__stories__/LayoutItem.stories.tsx @@ -68,6 +68,7 @@ const ControlPositionTemplate: StoryFn = (args) => ( ); export const Default = DefaultTemplate.bind({}); +export const WithContentList = DefaultTemplate.bind({}); export const Fullscreen = DefaultTemplate.bind({}); export const MetaInfo = DefaultTemplate.bind({}); export const Youtube = DefaultTemplate.bind({}); @@ -83,6 +84,16 @@ const DefaultArgs = { }; Default.args = DefaultArgs as LayoutItemProps; +WithContentList.args = { + ...DefaultArgs, + content: { + ...DefaultArgs.content, + list: data.withList.content.list.map((listItem) => ({ + ...listItem, + text: yfmTransform(listItem.text || ''), + })), + }, +} as LayoutItemProps; Fullscreen.args = {...DefaultArgs, ...data.fullscreen.content} as LayoutItemProps; MetaInfo.args = { ...DefaultArgs, diff --git a/src/sub-blocks/LayoutItem/__stories__/data.json b/src/sub-blocks/LayoutItem/__stories__/data.json index 12d575876..f1ef6f7f0 100644 --- a/src/sub-blocks/LayoutItem/__stories__/data.json +++ b/src/sub-blocks/LayoutItem/__stories__/data.json @@ -32,6 +32,36 @@ } } }, + "withList": { + "content": { + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ] + } + }, "withIcon": { "iconTop": { "value": "/story-assets/icon_1_light.svg", From 6c401ab918fa36473c453c41ce0674ae974762d5 Mon Sep 17 00:00:00 2001 From: ngorin Date: Mon, 11 Mar 2024 14:43:18 +0300 Subject: [PATCH 6/6] fix: fix comments --- .../__stories__/ExtendedFeatures.stories.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx index e95004656..30a920411 100644 --- a/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx +++ b/src/blocks/ExtendedFeatures/__stories__/ExtendedFeatures.stories.tsx @@ -32,12 +32,10 @@ const DefaultTemplate: StoryFn = (args) => ( const extendedFeaturesItems = (items: ExtendedFeaturesItem[]) => { return items.map((item) => ({ ...item, - list: - item.list && - item.list.map((listItem) => ({ - ...listItem, - text: listItem?.text && yfmTransform(listItem.text), - })), + list: item.list?.map((listItem) => ({ + ...listItem, + text: listItem?.text && yfmTransform(listItem.text), + })), text: item.text && yfmTransform(item.text), additionalInfo: item.additionalInfo && yfmTransform(item.additionalInfo), }));