Skip to content

Commit 560b867

Browse files
committed
fix: displaying video with fillWidthMedia param in HeaderBlock
1 parent 3d2bad2 commit 560b867

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

src/blocks/Header/Header.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ $backgroundWidth: 1440px;
152152
& > div {
153153
max-width: none;
154154
}
155+
156+
#{$block}__background-media {
157+
height: 100%;
158+
}
159+
160+
video {
161+
height: 100%;
162+
width: 100%;
163+
object-fit: cover;
164+
}
155165
}
156166
}
157167

src/blocks/Header/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Background = ({background}: BackgroundProps) => {
2727
return headerHasMediaBackground(background) ? (
2828
<BackgroundMedia
2929
{...background}
30+
mediaClassName={b('background-media')}
3031
className={b('background', {media: true, 'full-width-media': fullWidthMedia})}
3132
/>
3233
) : (

src/blocks/HeaderSlider/__stories__/data.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@
4141
}
4242
]
4343
},
44+
{
45+
"title": "Yandex Cloud Professionals Partner Program",
46+
"description": "Sell Yandex.Cloud services and receive a monthly partner premium from 12% to 20% of your customers' consumption. Get grants to get acquainted with Yandex.Cloud services or to conduct pilot projects for your clients.",
47+
"width": "s",
48+
"background": {
49+
"fullWidthMedia": true,
50+
"fullWidth": true,
51+
"disableCompress": true,
52+
"height": 800,
53+
"color": "lightgreen",
54+
"image": "https://storage.cloud-preprod.yandex.net/aeksandla-test/img-scale.png",
55+
"video": {
56+
"src": [
57+
"https://storage.yandexcloud.net/cloud-www-assets/scale/2022/main/scale_header.mp4"
58+
]
59+
}
60+
}
61+
},
4462
{
4563
"title": "Yandex Scale",
4664
"overtitle": "September 24",

src/components/BackgroundMedia/BackgroundMedia.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const b = block('BackgroundMedia');
1212

1313
export interface FullProps extends MediaProps, Animatable {
1414
className?: string;
15+
mediaClassName?: string;
1516
}
1617

1718
const BackgroundMedia = ({
@@ -20,6 +21,7 @@ const BackgroundMedia = ({
2021
animated,
2122
parallax = true,
2223
video,
24+
mediaClassName,
2325
...props
2426
}: FullProps) => {
2527
const isMobile = useContext(MobileContext);
@@ -31,7 +33,7 @@ const BackgroundMedia = ({
3133
animate={animated}
3234
>
3335
<Media
34-
className={b('media')}
36+
className={b('media', mediaClassName)}
3537
imageClassName={b('image')}
3638
videoClassName={b('video')}
3739
isBackground={true}

0 commit comments

Comments
 (0)