@@ -6,7 +6,6 @@ import {Button, Media, RouterLink} from '../../components';
66import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs' ;
77import { getMediaImage } from '../../components/Media/Image/utils' ;
88import YFMWrapper from '../../components/YFMWrapper/YFMWrapper' ;
9- import { MobileContext } from '../../context/mobileContext' ;
109import { useTheme } from '../../context/theme' ;
1110import { Col , Grid , Row } from '../../grid' ;
1211import { ClassNameProps , HeaderBlockBackground , HeaderBlockProps } from '../../models' ;
@@ -15,6 +14,8 @@ import {mergeVideoMicrodata} from '../../utils/microdata';
1514
1615import { getImageSize , getTitleSizes , titleWithImageSizes } from './utils' ;
1716import './Header.scss' ;
17+ import { useWindowWidth } from '../../context/windowWidthContext' ;
18+ import { BREAKPOINTS } from '../../constants' ;
1819
1920const b = block ( 'header-block' ) ;
2021
@@ -85,7 +86,8 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
8586 centered,
8687 additionalInfo,
8788 } = props ;
88- const isMobile = React . useContext ( MobileContext ) ;
89+ const windowWidth = useWindowWidth ( ) ;
90+ const isMobile = windowWidth <= BREAKPOINTS . sm ;
8991 const theme = useTheme ( ) ;
9092 const hasRightSideImage = Boolean ( ( image || video ) && ! centered ) ;
9193 const curImageSize = imageSize || getImageSize ( width ) ;
@@ -101,10 +103,7 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
101103 const videoThemed = video && getThemedValue ( video , theme ) ;
102104 const mediaWithMicrodata = mergeVideoMicrodata (
103105 { video : videoThemed , image : imageThemed } ,
104- {
105- name : title ,
106- description,
107- } ,
106+ { name : title , description} ,
108107 ) ;
109108 const fullWidth = backgroundThemed ?. fullWidth || backgroundThemed ?. fullWidthMedia ;
110109 const titleId = useUniqId ( ) ;
@@ -149,9 +148,7 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
149148 tagName = "div"
150149 className = { b ( 'overtitle' ) }
151150 content = { overtitle }
152- modifiers = { {
153- constructor : true ,
154- } }
151+ modifiers = { { constructor : true } }
155152 />
156153 ) : (
157154 overtitle
@@ -162,10 +159,7 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
162159 content = { title }
163160 contentClassName = { b ( 'title' ) }
164161 className = { b ( 'title-container' ) }
165- modifiers = { {
166- constructor : true ,
167- constructorTheme : textTheme ,
168- } }
162+ modifiers = { { constructor : true , constructorTheme : textTheme } }
169163 tagName = "h1"
170164 contentPosition = "end"
171165 >
0 commit comments