Skip to content

Commit 10cfe80

Browse files
author
Juli Ovechkina
authored
fix(Storybook): fix links (#123)
1 parent 29be1c5 commit 10cfe80

File tree

4 files changed

+82
-21
lines changed

4 files changed

+82
-21
lines changed

src/stories/BLOCKS.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,34 @@ _[Common field types](?id=information--common-types&viewMode=docs)_
1616

1717
## [Banner](?path=/story/blocks-banner--default&viewMode=docs)
1818

19-
## [CardLayout](?path=/story/blocks-cardlayout--cards-with-image&viewMode=docs)
19+
## [CardLayout](?path=/story/blocks-cardlayout--default&viewMode=docs)
2020

2121
## [Companies](?path=/story/blocks-companies--default&viewMode=docs)
2222

2323
## [ContentLayout](?path=/story/blocks-contentlayout--default&viewMode=docs)
2424

2525
## [ExtendedFeatures](?path=/story/blocks-extendedfeatures--default&viewMode=docs)
2626

27-
## [HeaderBlock](?path=/story/blocks-header--default&viewMode=docs)
27+
## [Header](?path=/story/blocks-header--default&viewMode=docs)
2828

2929
## [HeaderSlider](?path=/story/blocks-headerslider--default&viewMode=docs)
3030

3131
## [Icons](?path=/story/blocks-icons--default&viewMode=docs)
3232

33-
## [InfoBlock](?path=/story/blocks-info--default&viewMode=docs)
34-
35-
## [LinkTable](?path=/story/blocks-linktable--default-links-one-column&viewMode=docs)
33+
## [Info](?path=/story/blocks-info--default&viewMode=docs)
3634

3735
## [Media](?path=/story/blocks-media--default&viewMode=docs)
3836

39-
## [Preview](?path=/story/blocks-preview--default&viewMode=docs)
40-
41-
## [PromoFeaturesBlock](?path=/story/blocks-promofeaturesblock--default-theme&viewMode=docs)
37+
## [PromoFeatures](?path=/story/blocks-promofeaturesblock--default-theme&viewMode=docs)
4238

4339
## [Questions](?path=/story/blocks-questions--default&viewMode=docs)
4440

45-
## [SecurityBlock](?path=/story/blocks-security--dark-theme&viewMode=docs)
41+
## [Security](?path=/story/blocks-security--default&viewMode=docs)
4642

47-
## [Simple](?path=/story/blocks-simple--default&viewMode=docs)
43+
## [Share](?path=/story/blocks-share--default&viewMode=docs)
4844

4945
## [Slider](?path=/story/blocks-slider--default&viewMode=docs)
5046

51-
## [TableBlock](?path=/story/blocks-table--default&viewMode=docs)
47+
## [Table](?path=/story/blocks-table--default&viewMode=docs)
5248

53-
## [Questions](?path=/story/blocks-questions--default&viewMode=docs)
49+
## [Tabs](?path=/story/blocks-tabs--default&viewMode=docs)

src/stories/SUB_BLOCKS.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@ _Cards are components that are only used together with the slider or layout:_
1414

1515
- ### [BasicCard](?path=/story/components-cards-basiccard--default&viewMode=docs)
1616

17-
- ### [Tutorial](?path=/story/components-cards-tutorialcard--default&viewMode=docs)
18-
1917
- ### [Media](?path=/story/blocks-media--default&viewMode=docs)
2018

21-
- ### [Partner](?path=/story/components-cards-partner--default&viewMode=docs)
22-
2319
- ### [BackgroundCard](?path=/story/components-cards-backgroundcard--default&viewMode=docs)
2420

2521
- ### [CardWithImage](?path=/story/components-cards-cardwithimage--default&viewMode=docs)
2622

27-
- ### [NewsCard](?path=/story/components-cards-newscard--default&viewMode=docs)
28-
2923
## <a name="additionals">Additional sub-blocks</a>
3024

31-
## [Content](?path=/story/components-content--default&viewMode=docs)
25+
- ### [Content](?path=/story/components-content--default&viewMode=docs)
3226

33-
## [Price Detailed](?path=/story/components-cards-pricedetailed--marked-list&viewMode=docs)
27+
- ### [Price Detailed](?path=/story/components-cards-pricedetailed--marked-list&viewMode=docs)
3428

35-
## [Divider](?path=/story/components-divider--default&viewMode=docs)
29+
- ### [Divider](?path=/story/components-divider--default&viewMode=docs)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import {Meta, Story} from '@storybook/react/types-6-0';
2+
import React from 'react';
3+
import yfm from '@doc-tools/transform';
4+
5+
import BasicCard from '../../BasicCard/BasicCard';
6+
import Divider from '../Divider';
7+
import {BlockHeader} from '../../../components';
8+
import {BasicCardProps, DividerSize} from '../../../models';
9+
import {COMPONENTS} from '../../../demo/constants';
10+
11+
import data from './data.json';
12+
13+
export default {
14+
component: BasicCard,
15+
title: `${COMPONENTS}/Divider`,
16+
} as Meta;
17+
18+
const getSizeTitle = (size: string) => data.sizes.title.replace('{{size}}', size);
19+
const DefaultTemplate: Story<BasicCardProps> = (args) => (
20+
<div>
21+
<BlockHeader title={data.default.title} />
22+
<div style={{maxWidth: '400px', marginTop: '10px'}}>
23+
<BasicCard {...args} />
24+
<Divider />
25+
<BasicCard {...args} />
26+
</div>
27+
</div>
28+
);
29+
30+
const SizesTemplate: Story<BasicCardProps> = (args) => (
31+
<div>
32+
{data.sizes.items.map((item) => (
33+
<div key={item}>
34+
<BlockHeader title={getSizeTitle(item.toUpperCase())} />
35+
<div style={{maxWidth: '400px', marginTop: '10px', marginBottom: '24px'}}>
36+
<BasicCard {...args} />
37+
<Divider size={item as DividerSize} />
38+
<BasicCard {...args} />
39+
</div>
40+
</div>
41+
))}
42+
</div>
43+
);
44+
45+
export const Default = DefaultTemplate.bind({});
46+
export const Sizes = SizesTemplate.bind({});
47+
48+
const DefaultArgs = {
49+
...data.default.content,
50+
text: yfm(data.default.content.text).result.html,
51+
};
52+
53+
Default.args = {
54+
...data.default.content,
55+
...DefaultArgs,
56+
} as BasicCardProps;
57+
Sizes.args = DefaultArgs as BasicCardProps;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default": {
3+
"title": "Default divider between cards, size M",
4+
"content": {
5+
"url": "https://example.com",
6+
"title": "Lorem ipsum",
7+
"text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
8+
}
9+
},
10+
"sizes": {
11+
"title": "Divider between cards, size {{size}}",
12+
"items": ["0", "xxs", "xs", "s", "m", "l", "xl", "xxl", "xxxl"]
13+
}
14+
}

0 commit comments

Comments
 (0)