{{- vf_hero_kicker | safe -}}
diff --git a/components/vf-hero/vf-hero.react.js b/components/vf-hero/vf-hero.react.js index 3199ab0102..bd6b9b254f 100644 --- a/components/vf-hero/vf-hero.react.js +++ b/components/vf-hero/vf-hero.react.js @@ -14,14 +14,31 @@ function VfHero({ vf_hero_link_href, vf_hero_image, vf_hero_image_size, + vf_hero_image_src, + vf_hero_image_mobile_src, + vf_hero_image_large_src, + vf_hero_image_alt, + vf_hero_image_width = "1920", + vf_hero_image_height = "1080", + vf_hero_image_fetchpriority = "high", + vf_hero_image_loading = "eager", + vf_hero_image_sizes, vf_hero_kicker, vf_hero_heading_additional, modifier_class }) { - const classNames = `vf-hero vf-u-fullbleed ${modifier_class || ""}`; + const hasResponsiveMedia = + !!vf_hero_image_src || + !!vf_hero_image_mobile_src || + !!vf_hero_image_large_src; + const resolvedImageSizes = + vf_hero_image_sizes || "(max-width: 767px) 100vw, 1920px"; + const classNames = `vf-hero${ + hasResponsiveMedia ? " vf-hero--has-media" : "" + } vf-u-fullbleed ${modifier_class || ""}`; const styles = { - "--vf-hero--bg-image": vf_hero_image, - "--vf-hero--bg-image-size": vf_hero_image_size + ...(vf_hero_image && { "--vf-hero--bg-image": vf_hero_image }), + ...(vf_hero_image_size && { "--vf-hero--bg-image-size": vf_hero_image_size }) }; const attributes = { ...(id && { id }) @@ -34,6 +51,30 @@ function VfHero({ className={classNames} style={styles} > + {hasResponsiveMedia ? ( +{vf_hero_kicker}
@@ -41,7 +82,9 @@ function VfHero({ {vf_hero_heading ? (