@@ -5,6 +5,7 @@ import { useTheme } from "../../context/themeContext"
5
5
import "./Banner.scss"
6
6
import PropTypes from 'prop-types'
7
7
import CustomLink from "../CustomLink/CustomLink"
8
+ import CustomImage from "../CustomImage/CustomImage"
8
9
9
10
const Banner = ( { data } ) => {
10
11
const { theme } = useTheme ( )
@@ -21,23 +22,21 @@ const Banner = ({ data }) => {
21
22
const showTitle = ( ) => {
22
23
if ( variant === "diagonal" || variant === "diagonalReverse" ) {
23
24
return < h2 > { title } </ h2 >
24
- } else {
25
- return < h1 > { title } </ h1 >
26
25
}
26
+
27
+ return < h1 > { title } </ h1 >
27
28
}
28
29
29
30
return (
30
31
< div className = { `banner ${ variant } ` } >
31
32
< div className = "container banner__wrapper" >
32
33
{ variant === "background" ?
33
- < div
34
- className = "bgImage"
34
+ < div className = "bgImage"
35
35
style = { {
36
- backgroundImage : `url(${ image ?. url } )` ,
36
+ backgroundImage : image ? `url(${ image ?. url } )` : '' ,
37
37
backgroundPosition : 'center' ,
38
- // backgroundSize: 'cover',
39
38
} } >
40
- < div className = "title-background " >
39
+ < div className = "title-background" >
41
40
< h1 style = { { color : theme === 'dark' ? 'white' : '#3F6BE8' } } > { title } </ h1 >
42
41
{ summary && (
43
42
< MarkdownView
@@ -77,19 +76,18 @@ const Banner = ({ data }) => {
77
76
</ div >
78
77
79
78
< div className = "imagen" >
80
- { image ?. url ? (
81
- < img
82
- src = { theme === "dark" && imageDark ? imageDark ?. url : image ?. url }
79
+ { image ? (
80
+ < CustomImage image = { theme === 'dark' && imageDark ? imageDark : image }
81
+ alt = { image ?. alternativeText || title }
82
+ className = { '' }
83
83
width = { 290 }
84
84
height = { 200 }
85
- alt = { image ?. alternativeText || title }
86
- /> ) : (
85
+ />
86
+ ) : (
87
87
< div className = "cont-lottie" >
88
- { animation && < Lottie options = { {
89
- ...defaultOptions ,
90
- animationData : animation ,
91
- } }
92
- /> }
88
+ { animation && (
89
+ < Lottie options = { { ...defaultOptions , animationData : animation } } />
90
+ ) }
93
91
</ div >
94
92
) }
95
93
</ div >
0 commit comments