Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: asset path in new stories #777

Merged
merged 2 commits into from
Jan 17, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 8 additions & 50 deletions src/blocks/CardLayout/__stories__/CardLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,15 @@ const DefaultTemplate: StoryFn<CardLayoutBlockModel> = (args) => (
children: [
{
...data.cards.priceCard,
buttons: [
{
text: 'Button',
url: 'https://example.com',
width: 'max',
theme: 'outlined',
},
],
buttons: [data.buttons.outlined],
},
{
...data.cards.priceCard,
buttons: [
{
text: 'Button',
url: 'https://example.com',
width: 'max',
theme: 'action',
},
],
buttons: [data.buttons.action],
},
{
...data.cards.priceCard,
buttons: [
{
text: 'Button',
url: 'https://example.com',
width: 'max',
theme: 'monochrome',
},
],
buttons: [data.buttons.monochrome],
},
],
},
Expand Down Expand Up @@ -168,47 +147,26 @@ const WithBackgroundTemplate: StoryFn<CardLayoutBlockModel> = (args) => (
blocks: [
{
...args,
background: {
src: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/content-bg-img_light.png',
disableCompress: true,
},
background: data.backgrounds.image,
children: createCardArray(8, data.cards.basicCard),
},
{
...args,
title: 'Card layout with background color (basic cards)',
background: {
style: {
backgroundColor: '#EEF2F8',
},
},
background: data.backgrounds.backgroundColor,
children: createCardArray(4, data.cards.basicCard),
},
{
...args,
background: {
border: 'shadow',
style: {
backgroundColor: '#7CCEA0',
},
},
background: data.backgrounds.backgroundColorAndShadow,
title: 'Card layout with background color and shadow (layout items)',
description:
'Three cards in a row on the desktop, three cards in a row on a tablet, one card in a row on a mobile phone.',
colSizes: {
all: 12,
sm: 4,
md: 4,
},
...data.colSizes.threeOne,
children: createCardArray(3, data.cards.layoutItem),
},
{
...args,
title: 'Card layout with background image (price cards)',
background: {
src: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/content-bg-img_light.png',
disableCompress: true,
},
background: data.backgrounds.image,
children: createCardArray(4, data.cards.priceCard),
},
],
Expand Down
51 changes: 48 additions & 3 deletions src/blocks/CardLayout/__stories__/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "basic-card",
"title": "Tell a story and build a narrative",
"text": "We are all storytellers. Stories are a powerful way to communicate ideas and share information. The right story can lead to a better understanding of a situation, make us laugh, or even inspire us to do something in the future.",
"icon": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_1_light.svg"
"icon": "/story-assets/icon_1_light.svg"
},
"layoutItem": {
"type": "layout-item",
Expand All @@ -22,12 +22,12 @@
"text": "We are all storytellers. Stories are a powerful way to communicate ideas and share information. The right story can lead to a better understanding of a situation, make us laugh, or even inspire us to do something in the future.",
"background": {
"light": {
"src": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-bg_nopadding_4-12_light.png",
"src": "/story-assets/img-bg_nopadding_4-12_light.png",
"alt": "Lorem ipsumt",
"disableCompress": true
},
"dark": {
"src": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-bg_nopadding_4-12_dark.png",
"src": "/story-assets/img-bg_nopadding_4-12_dark.png",
"alt": "Lorem ipsumt"
}
}
Expand All @@ -45,6 +45,43 @@
]
}
},
"buttons": {
"outlined": {
"text": "Button",
"url": "https://example.com",
"width": "max",
"theme": "outlined"
},
"action": {
"text": "Button",
"url": "https://example.com",
"width": "max",
"theme": "action"
},
"monochrome": {
"text": "Button",
"url": "https://example.com",
"width": "max",
"theme": "monochrome"
}
},
"backgrounds": {
"image": {
"src": "/story-assets/content-bg-img_light.png",
"disableCompress": true
},
"backgroundColor": {
"style": {
"backgroundColor": "#EEF2F8"
}
},
"backgroundColorAndShadow": {
"border": "shadow",
"style": {
"backgroundColor": "#7CCEA0"
}
}
},
"default": {
"content": {
"type": "card-layout-block",
Expand Down Expand Up @@ -86,6 +123,14 @@
"colSizes": {
"all": 6
}
},
"threeOne": {
"description": "Three cards in a row on the desktop, three cards in a row on a tablet, one card in a row on a mobile phone.",
"colSizes": {
"all": 12,
"sm": 4,
"md": 4
}
}
},
"withBackground": {
Expand Down
Loading