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

feat(Tabs): add image variative height for media #612

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 3 additions & 6 deletions src/blocks/Media/__stories__/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export const TabsBlock = ({
key={activeTab}
className={b('media')}
playVideo={play}
height={mediaHeight}
height={activeTabData.media?.video && mediaHeight}
imageClassName={b('image')}
/>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/Tabs/__stories__/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Media/Media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

const qaAttributes = getQaAttrubutes(qa, 'video');

console.log(height);

Check warning on line 50 in src/components/Media/Media.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected console statement

const content = useMemo(() => {
let result: ReactElement | ReactElement[] = [];

Expand Down
Loading