From a180c0e74e6fb7b8062699dde8fdb8d0d505309b Mon Sep 17 00:00:00 2001 From: Juli Ovechkina Date: Mon, 2 Oct 2023 18:25:21 +0100 Subject: [PATCH 1/3] feat(Tabs): add image variative height for media --- src/blocks/Media/__stories__/data.json | 9 +++------ src/blocks/Tabs/Tabs.tsx | 3 ++- src/blocks/Tabs/__stories__/data.json | 4 ++-- src/components/Media/Media.tsx | 2 ++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/blocks/Media/__stories__/data.json b/src/blocks/Media/__stories__/data.json index 09a99f5d0..d400a8b5d 100644 --- a/src/blocks/Media/__stories__/data.json +++ b/src/blocks/Media/__stories__/data.json @@ -87,11 +87,10 @@ "title": "Video with auto loop and without controls", "media": { "light": { + "previewImg": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png", "video": { "src": [ - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm", - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.mp4", - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png" + "https://storage.yandexcloud.net/cloud-www-assets/constructor/main/new/podd-00-13-01.mp4" ], "loop": { "start": 0 @@ -208,9 +207,7 @@ "video": { "type": "player", "src": [ - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm", - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.mp4", - "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png" + "https://storage.yandexcloud.net/cloud-www-assets/constructor/main/new/podd-00-13-01.mp4" ], "autoplay": false, "ariaLabel": "Video accessible name example" diff --git a/src/blocks/Tabs/Tabs.tsx b/src/blocks/Tabs/Tabs.tsx index 8ac8db90f..e990cd8ab 100644 --- a/src/blocks/Tabs/Tabs.tsx +++ b/src/blocks/Tabs/Tabs.tsx @@ -90,7 +90,8 @@ export const TabsBlock = ({ key={activeTab} className={b('media')} playVideo={play} - height={mediaHeight} + height={activeTabData.media?.video && mediaHeight} + imageClassName={b('image')} /> )} diff --git a/src/blocks/Tabs/__stories__/data.json b/src/blocks/Tabs/__stories__/data.json index f78d6cc4f..3e8f8cea8 100644 --- a/src/blocks/Tabs/__stories__/data.json +++ b/src/blocks/Tabs/__stories__/data.json @@ -42,7 +42,7 @@ "start": 0 } }, - "image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_white.png" + "previewImage": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_white.png" }, "dark": { "video": { @@ -55,7 +55,7 @@ "start": 0 } }, - "image": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_dark.png" + "previewImage": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_dark.png" } }, "caption": "Dolor sit amet", diff --git a/src/components/Media/Media.tsx b/src/components/Media/Media.tsx index ce71fe055..fe804b564 100644 --- a/src/components/Media/Media.tsx +++ b/src/components/Media/Media.tsx @@ -47,6 +47,8 @@ export const Media = (props: MediaAllProps) => { const qaAttributes = getQaAttrubutes(qa, 'video'); + console.log(height); + const content = useMemo(() => { let result: ReactElement | ReactElement[] = []; From 8bdd81b2f958aa700812e04f5d35a4471aaedd65 Mon Sep 17 00:00:00 2001 From: Juli Ovechkina Date: Thu, 5 Oct 2023 15:53:09 +0100 Subject: [PATCH 2/3] fix: remove console log --- src/blocks/Media/__stories__/data.json | 8 ++++++-- src/components/Media/Media.tsx | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/blocks/Media/__stories__/data.json b/src/blocks/Media/__stories__/data.json index d400a8b5d..c2aa0e342 100644 --- a/src/blocks/Media/__stories__/data.json +++ b/src/blocks/Media/__stories__/data.json @@ -90,7 +90,9 @@ "previewImg": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png", "video": { "src": [ - "https://storage.yandexcloud.net/cloud-www-assets/constructor/main/new/podd-00-13-01.mp4" + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm", + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.mp4", + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png" ], "loop": { "start": 0 @@ -207,7 +209,9 @@ "video": { "type": "player", "src": [ - "https://storage.yandexcloud.net/cloud-www-assets/constructor/main/new/podd-00-13-01.mp4" + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm", + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.mp4", + "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png" ], "autoplay": false, "ariaLabel": "Video accessible name example" diff --git a/src/components/Media/Media.tsx b/src/components/Media/Media.tsx index fe804b564..ce71fe055 100644 --- a/src/components/Media/Media.tsx +++ b/src/components/Media/Media.tsx @@ -47,8 +47,6 @@ export const Media = (props: MediaAllProps) => { const qaAttributes = getQaAttrubutes(qa, 'video'); - console.log(height); - const content = useMemo(() => { let result: ReactElement | ReactElement[] = []; From 9b73705997099559200a3ccb649895bcb6da96c6 Mon Sep 17 00:00:00 2001 From: Juli Ovechkina Date: Fri, 6 Oct 2023 13:44:02 +0100 Subject: [PATCH 3/3] fix: remove unnecessary preview --- src/blocks/Media/__stories__/data.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blocks/Media/__stories__/data.json b/src/blocks/Media/__stories__/data.json index c2aa0e342..09a99f5d0 100644 --- a/src/blocks/Media/__stories__/data.json +++ b/src/blocks/Media/__stories__/data.json @@ -87,7 +87,6 @@ "title": "Video with auto loop and without controls", "media": { "light": { - "previewImg": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.png", "video": { "src": [ "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm",