Skip to content

Commit b8d8125

Browse files
committed
feat: add translations for components and sub blocks stories
1 parent 64e0999 commit b8d8125

File tree

119 files changed

+1869
-2715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1869
-2715
lines changed

src/components/Author/__stories__/Author.stories.tsx

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,22 @@ import {Meta, Story} from '@storybook/react/types-6-0';
22
import React from 'react';
33

44
import Author from '../Author';
5-
import {AuthorProps, AuthorType} from '../../../models';
5+
import {AuthorProps} from '../../../models';
66
import {COMPONENTS} from '../../../demo/constants';
77

8+
import data from './data.json';
9+
810
export default {
911
component: Author,
1012
title: `${COMPONENTS}/Author`,
1113
} as Meta;
1214

13-
const avatarNoWebp = 'https://storage.cloud-preprod.yandex.net/cloud-www-community-images/oleg.png';
14-
const avatarWebp =
15-
'https://storage.cloud-preprod.yandex.net/cloud-www-assets/blog-assets/ru/posts/2022/oleg.png';
16-
const author = {
17-
firstName: 'Олег',
18-
secondName: 'Коверзнев',
19-
description:
20-
'В Яндексе с июля 2017 года. Возглавляет команду, которая формирует стратегию развития бизнеса Yandex.Cloud и выстраивает работу с клиентами и партнерами.',
21-
avatar: avatarWebp,
22-
};
23-
2415
const DefaultTemplate: Story<AuthorProps> = (args) => <Author {...args} />;
2516

2617
export const Default = DefaultTemplate.bind({});
2718
export const TextUnderImage = DefaultTemplate.bind({});
2819
export const NoWebpInAvatar = DefaultTemplate.bind({});
2920

30-
Default.args = {
31-
author,
32-
type: AuthorType.Line,
33-
};
34-
35-
TextUnderImage.args = {
36-
author,
37-
type: AuthorType.Column,
38-
};
39-
40-
NoWebpInAvatar.args = {
41-
author: {
42-
...author,
43-
avatar: avatarNoWebp,
44-
},
45-
type: AuthorType.Line,
46-
};
21+
Default.args = data.default.content as AuthorProps;
22+
TextUnderImage.args = data.textUnderImage.content as AuthorProps;
23+
NoWebpInAvatar.args = data.noWebpInAvatar.content as AuthorProps;

src/components/Author/__stories__/Author_content.json

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"default": {
3+
"content": {
4+
"author": {
5+
"firstName": "Oleg",
6+
"secondName": "Koverznev",
7+
"description": "Joined Yandex in July 2017. Leads the team that is responsible for the Yandex Cloud business development strategy and customer and partner relations.",
8+
"avatar": "https://storage.cloud-preprod.yandex.net/cloud-www-assets/blog-assets/ru/posts/2022/oleg.png"
9+
},
10+
"type": "line"
11+
}
12+
},
13+
"textUnderImage": {
14+
"content": {
15+
"author": {
16+
"firstName": "Oleg",
17+
"secondName": "Koverznev",
18+
"description": "Joined Yandex in July 2017. Leads the team that is responsible for the Yandex Cloud business development strategy and customer and partner relations.",
19+
"avatar": "https://storage.cloud-preprod.yandex.net/cloud-www-assets/blog-assets/ru/posts/2022/oleg.png"
20+
},
21+
"type": "column"
22+
}
23+
},
24+
"noWebpInAvatar": {
25+
"content": {
26+
"author": {
27+
"firstName": "Oleg",
28+
"secondName": "Koverznev",
29+
"description": "Joined Yandex in July 2017. Leads the team that is responsible for the Yandex Cloud business development strategy and customer and partner relations.",
30+
"avatar": "https://storage.cloud-preprod.yandex.net/cloud-www-community-images/oleg.png"
31+
},
32+
"type": "line"
33+
}
34+
}
35+
}

src/components/BackLink/__stories__/BackLink.stories.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import BackLink, {BackLinkProps} from '../BackLink';
55
import {BUTTONS_LINKS, COMPONENTS} from '../../../demo/constants';
66
import {Col, Row} from '../../../grid';
77

8+
import data from './data.json';
9+
810
export default {
911
component: BackLink,
1012
title: `${COMPONENTS}/${BUTTONS_LINKS}/BackLink`,
@@ -47,15 +49,5 @@ const ThemesSizesTemplate: Story<BackLinkProps> = (args) => (
4749
export const Default = DefaultTemplate.bind({});
4850
export const ThemesSizes = ThemesSizesTemplate.bind({});
4951

50-
Default.args = {
51-
url: '#',
52-
title: 'ReactNode',
53-
theme: 'default',
54-
size: 'l',
55-
shouldHandleBackAction: true,
56-
};
57-
58-
ThemesSizes.args = {
59-
url: '#',
60-
shouldHandleBackAction: true,
61-
};
52+
Default.args = data.default.content as BackLinkProps;
53+
ThemesSizes.args = data.themesSizes.content as BackLinkProps;

src/components/BackLink/__stories__/BackLink_content.json

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"default": {
3+
"content": {
4+
"url": "#",
5+
"title": "ReactNode",
6+
"theme": "default",
7+
"size": "l",
8+
"shouldHandleBackAction": true
9+
}
10+
},
11+
"themesSizes": {
12+
"content": {
13+
"url": "#",
14+
"shouldHandleBackAction": true
15+
}
16+
}
17+
}

src/components/BackgroundImage/__stories__/BackgroundImage.stories.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import BackgroundImage from '../BackgroundImage';
55
import {COMPONENTS, MEDIA} from '../../../demo/constants';
66
import {BackgroundImageProps} from '../../../models';
77

8+
import data from './data.json';
9+
810
export default {
911
component: BackgroundImage,
1012
title: `${COMPONENTS}/${MEDIA}/BackgroundImage`,
@@ -18,13 +20,4 @@ const DefaultTemplate: Story<BackgroundImageProps> = (args) => (
1820

1921
export const Default = DefaultTemplate.bind({});
2022

21-
Default.args = {
22-
src: 'https://storage.cloud-preprod.yandex.net/berdysheva-test/bg_card_0001.png',
23-
alt: 'string',
24-
disableCompress: true,
25-
style: {
26-
height: '500px',
27-
},
28-
imageClassName: '',
29-
hide: false,
30-
};
23+
Default.args = data.default.content as BackgroundImageProps;

src/components/BackgroundImage/__stories__/BackgroundImage_content.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default": {
3+
"content": {
4+
"src": "https://storage.cloud-preprod.yandex.net/berdysheva-test/bg_card_0001.png",
5+
"alt": "string",
6+
"disableCompress": true,
7+
"style": {
8+
"height": "500px"
9+
},
10+
"imageClassName": "",
11+
"hide": false
12+
}
13+
}
14+
}

src/components/BackgroundMedia/__stories__/BackgroundMedia.stories.tsx

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import React from 'react';
44
import BackgroundMedia, {FullProps} from '../BackgroundMedia';
55
import {COMPONENTS, MEDIA} from '../../../demo/constants';
66

7+
import data from './data.json';
8+
79
export default {
810
component: BackgroundMedia,
911
title: `${COMPONENTS}/${MEDIA}/BackgroundMedia`,
@@ -24,30 +26,6 @@ export const Image = DefaultTemplate.bind({});
2426
export const ImageSlider = DefaultTemplate.bind({});
2527
export const Video = DefaultTemplate.bind({});
2628

27-
Image.args = {
28-
image: {
29-
src: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/services/tracker/background_tracker_x2.png',
30-
alt: 'Картинка',
31-
disableCompress: true,
32-
},
33-
};
34-
35-
ImageSlider.args = {
36-
image: [
37-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/services/tracker/background_tracker_x2.png',
38-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/services/datalens/background_datalens_2x.png',
39-
],
40-
};
41-
42-
Video.args = {
43-
video: {
44-
src: [
45-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/main-visual/main_video.mp4',
46-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/main-visual/main_video.ogv',
47-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/main-visual/main_video.webm',
48-
'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/main-visual/mobile.png',
49-
],
50-
loop: {start: 0},
51-
},
52-
image: 'https://storage.yandexcloud.net/cloud-www-assets/constructor/main/main-visual/main.png',
53-
};
29+
Image.args = data.image.content;
30+
ImageSlider.args = data.imageSlider.content;
31+
Video.args = data.video.content;

0 commit comments

Comments
 (0)