Skip to content

Commit dcb1c2a

Browse files
author
yuberdysheva
authored
fix: change p margin for size s (#29)
* fix: change p margin for size s
1 parent 36ee592 commit dcb1c2a

File tree

7 files changed

+269
-575
lines changed

7 files changed

+269
-575
lines changed

src/blocks/ContentLayout/__stories__/ContentLayout.stories.tsx

Lines changed: 108 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import yfm from '@doc-tools/transform';
23
import {Meta, Story} from '@storybook/react/types-6-0';
34
import {ContentLayoutBlockModel, ContentLayoutBlockProps} from '../../../models';
45
import Content from '../ContentLayout';
@@ -46,7 +47,7 @@ const ThemesTemplate: Story<ContentLayoutBlockModel> = (args) => (
4647
{
4748
...args,
4849
properties: {
49-
...args,
50+
...args.properties,
5051
theme: 'dark',
5152
background: {
5253
style: {
@@ -76,7 +77,7 @@ const ThemesTemplate: Story<ContentLayoutBlockModel> = (args) => (
7677
{
7778
...args,
7879
properties: {
79-
...args,
80+
...args.properties,
8081
theme: 'light',
8182
background: {
8283
style: {
@@ -114,17 +115,17 @@ const TextWidthTemplate: Story<ContentLayoutBlockModel> = (args) => (
114115
blocks: [
115116
{
116117
...args,
117-
properties: {...args, textWidth: 's'},
118+
properties: {...args.properties, textWidth: 's'},
118119
textContent: {title: getTextWidthTitle('S'), ...args.textContent},
119120
},
120121
{
121122
...args,
122-
properties: {...args, textWidth: 'm'},
123+
properties: {...args.properties, textWidth: 'm'},
123124
textContent: {title: getTextWidthTitle('M'), ...args.textContent},
124125
},
125126
{
126127
...args,
127-
properties: {...args, textWidth: 'l'},
128+
properties: {...args.properties, textWidth: 'l'},
128129
textContent: {title: getTextWidthTitle('L'), ...args.textContent},
129130
},
130131
],
@@ -138,15 +139,15 @@ const TextWidthTemplateWithoutTitle: Story<ContentLayoutBlockModel> = (args) =>
138139
blocks: [
139140
{
140141
...args,
141-
properties: {...args, textWidth: 's'},
142+
properties: {...args.properties, textWidth: 's'},
142143
},
143144
{
144145
...args,
145-
properties: {...args, textWidth: 'm'},
146+
properties: {...args.properties, textWidth: 'm'},
146147
},
147148
{
148149
...args,
149-
properties: {...args, textWidth: 'l'},
150+
properties: {...args.properties, textWidth: 'l'},
150151
},
151152
],
152153
}}
@@ -163,13 +164,102 @@ export const Theme = ThemesTemplate.bind([]);
163164
export const TextWidth = TextWidthTemplate.bind([]);
164165
export const TextWidthWithoutTitle = TextWidthTemplateWithoutTitle.bind([]);
165166

166-
Default.args = data.default.content as ContentLayoutBlockProps;
167-
WithFiles.args = data.withFiles.content as ContentLayoutBlockProps;
168-
Size.args = data.size.content as ContentLayoutBlockProps;
169-
WithBackgroundSizeS.args = data.withBackgroundSizeS.content as ContentLayoutBlockProps;
170-
WithImageAndBackgroundSizeL.args = data.withImageAndBackgroundSizeL
171-
.content as ContentLayoutBlockProps;
172-
WithImageSizeSCentered.args = data.withImageSizeSCentered.content as ContentLayoutBlockProps;
173-
Theme.args = data.theme.content as ContentLayoutBlockProps;
174-
TextWidth.args = data.textWidth.content as ContentLayoutBlockProps;
175-
TextWidthWithoutTitle.args = data.textWidthWithoutTitle.content as ContentLayoutBlockProps;
167+
Default.args = {
168+
...data.default.content,
169+
textContent: {
170+
...data.default.content.textContent,
171+
title: data.common.title,
172+
text: yfm(data.common.text).result.html,
173+
additionalInfo: yfm(data.common.additionalInfo).result.html,
174+
buttons: data.common.buttons,
175+
},
176+
} as ContentLayoutBlockProps;
177+
178+
WithFiles.args = {
179+
...data.withFiles.content,
180+
textContent: {
181+
...data.withFiles.content.textContent,
182+
text: yfm(data.common.text).result.html,
183+
additionalInfo: yfm(data.common.additionalInfo).result.html,
184+
links: data.common.links,
185+
},
186+
fileContent: data.common.fileContent,
187+
} as ContentLayoutBlockProps;
188+
189+
Size.args = {
190+
...data.size.content,
191+
textContent: {
192+
text: yfm(data.common.text).result.html,
193+
additionalInfo: yfm(data.common.additionalInfo).result.html,
194+
buttons: data.common.buttons,
195+
links: data.common.links,
196+
},
197+
fileContent: data.common.fileContent,
198+
} as ContentLayoutBlockProps;
199+
200+
WithBackgroundSizeS.args = {
201+
...data.withBackgroundSizeS.content,
202+
textContent: {
203+
...data.withBackgroundSizeS.content.textContent,
204+
text: yfm(data.common.text).result.html,
205+
additionalInfo: yfm(data.common.additionalInfo).result.html,
206+
buttons: data.common.buttons,
207+
links: data.common.links,
208+
},
209+
fileContent: data.common.fileContent,
210+
} as ContentLayoutBlockProps;
211+
212+
WithImageAndBackgroundSizeL.args = {
213+
...data.withImageAndBackgroundSizeL.content,
214+
textContent: {
215+
...data.withImageAndBackgroundSizeL.content.textContent,
216+
text: yfm(data.common.text).result.html,
217+
additionalInfo: yfm(data.common.additionalInfo).result.html,
218+
buttons: data.common.buttons,
219+
links: data.common.links,
220+
},
221+
fileContent: data.common.fileContent,
222+
} as ContentLayoutBlockProps;
223+
224+
WithImageSizeSCentered.args = {
225+
...data.withImageSizeSCentered.content,
226+
textContent: {
227+
...data.withImageSizeSCentered.content.textContent,
228+
text: yfm(data.common.text).result.html,
229+
additionalInfo: yfm(data.common.additionalInfo).result.html,
230+
buttons: data.common.buttons,
231+
links: data.common.links,
232+
},
233+
} as ContentLayoutBlockProps;
234+
235+
Theme.args = {
236+
...data.theme.content,
237+
textContent: {
238+
text: yfm(data.common.text).result.html,
239+
additionalInfo: yfm(data.common.additionalInfo).result.html,
240+
links: data.common.links,
241+
},
242+
fileContent: data.common.fileContent,
243+
} as ContentLayoutBlockProps;
244+
245+
TextWidth.args = {
246+
...data.textWidth.content,
247+
textContent: {
248+
text: yfm(data.common.text).result.html,
249+
additionalInfo: yfm(data.common.additionalInfo).result.html,
250+
buttons: data.common.buttons,
251+
links: data.common.links,
252+
},
253+
fileContent: data.common.fileContent,
254+
} as ContentLayoutBlockProps;
255+
256+
TextWidthWithoutTitle.args = {
257+
...data.textWidthWithoutTitle.content,
258+
textContent: {
259+
text: yfm(data.common.text).result.html,
260+
additionalInfo: yfm(data.common.additionalInfo).result.html,
261+
buttons: data.common.buttons,
262+
links: data.common.links,
263+
},
264+
fileContent: data.common.fileContent,
265+
} as ContentLayoutBlockProps;

0 commit comments

Comments
 (0)