Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 108 additions & 18 deletions src/blocks/ContentLayout/__stories__/ContentLayout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import yfm from '@doc-tools/transform';
import {Meta, Story} from '@storybook/react/types-6-0';
import {ContentLayoutBlockModel, ContentLayoutBlockProps} from '../../../models';
import Content from '../ContentLayout';
Expand Down Expand Up @@ -46,7 +47,7 @@ const ThemesTemplate: Story<ContentLayoutBlockModel> = (args) => (
{
...args,
properties: {
...args,
...args.properties,
theme: 'dark',
background: {
style: {
Expand Down Expand Up @@ -76,7 +77,7 @@ const ThemesTemplate: Story<ContentLayoutBlockModel> = (args) => (
{
...args,
properties: {
...args,
...args.properties,
theme: 'light',
background: {
style: {
Expand Down Expand Up @@ -114,17 +115,17 @@ const TextWidthTemplate: Story<ContentLayoutBlockModel> = (args) => (
blocks: [
{
...args,
properties: {...args, textWidth: 's'},
properties: {...args.properties, textWidth: 's'},
textContent: {title: getTextWidthTitle('S'), ...args.textContent},
},
{
...args,
properties: {...args, textWidth: 'm'},
properties: {...args.properties, textWidth: 'm'},
textContent: {title: getTextWidthTitle('M'), ...args.textContent},
},
{
...args,
properties: {...args, textWidth: 'l'},
properties: {...args.properties, textWidth: 'l'},
textContent: {title: getTextWidthTitle('L'), ...args.textContent},
},
],
Expand All @@ -138,15 +139,15 @@ const TextWidthTemplateWithoutTitle: Story<ContentLayoutBlockModel> = (args) =>
blocks: [
{
...args,
properties: {...args, textWidth: 's'},
properties: {...args.properties, textWidth: 's'},
},
{
...args,
properties: {...args, textWidth: 'm'},
properties: {...args.properties, textWidth: 'm'},
},
{
...args,
properties: {...args, textWidth: 'l'},
properties: {...args.properties, textWidth: 'l'},
},
],
}}
Expand All @@ -163,13 +164,102 @@ export const Theme = ThemesTemplate.bind([]);
export const TextWidth = TextWidthTemplate.bind([]);
export const TextWidthWithoutTitle = TextWidthTemplateWithoutTitle.bind([]);

Default.args = data.default.content as ContentLayoutBlockProps;
WithFiles.args = data.withFiles.content as ContentLayoutBlockProps;
Size.args = data.size.content as ContentLayoutBlockProps;
WithBackgroundSizeS.args = data.withBackgroundSizeS.content as ContentLayoutBlockProps;
WithImageAndBackgroundSizeL.args = data.withImageAndBackgroundSizeL
.content as ContentLayoutBlockProps;
WithImageSizeSCentered.args = data.withImageSizeSCentered.content as ContentLayoutBlockProps;
Theme.args = data.theme.content as ContentLayoutBlockProps;
TextWidth.args = data.textWidth.content as ContentLayoutBlockProps;
TextWidthWithoutTitle.args = data.textWidthWithoutTitle.content as ContentLayoutBlockProps;
Default.args = {
...data.default.content,
textContent: {
...data.default.content.textContent,
title: data.common.title,
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
},
} as ContentLayoutBlockProps;

WithFiles.args = {
...data.withFiles.content,
textContent: {
...data.withFiles.content.textContent,
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

Size.args = {
...data.size.content,
textContent: {
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

WithBackgroundSizeS.args = {
...data.withBackgroundSizeS.content,
textContent: {
...data.withBackgroundSizeS.content.textContent,
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

WithImageAndBackgroundSizeL.args = {
...data.withImageAndBackgroundSizeL.content,
textContent: {
...data.withImageAndBackgroundSizeL.content.textContent,
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

WithImageSizeSCentered.args = {
...data.withImageSizeSCentered.content,
textContent: {
...data.withImageSizeSCentered.content.textContent,
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
} as ContentLayoutBlockProps;

Theme.args = {
...data.theme.content,
textContent: {
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

TextWidth.args = {
...data.textWidth.content,
textContent: {
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;

TextWidthWithoutTitle.args = {
...data.textWidthWithoutTitle.content,
textContent: {
text: yfm(data.common.text).result.html,
additionalInfo: yfm(data.common.additionalInfo).result.html,
buttons: data.common.buttons,
links: data.common.links,
},
fileContent: data.common.fileContent,
} as ContentLayoutBlockProps;
Loading