File tree Expand file tree Collapse file tree 2 files changed +33
-31
lines changed
plugins/gatsby-plugin-announcement-banner
src/components/shared/announcement-banner Expand file tree Collapse file tree 2 files changed +33
-31
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const UniversalWrapper = ({ element, pluginOptions }) => {
24
24
const isGAEnabled =
25
25
label && action && readMoreButtonCategory && dismissButtonCategory ;
26
26
27
- React . useEffect ( ( ) => {
27
+ React . useLayoutEffect ( ( ) => {
28
28
setShouldBeMounted ( true ) ;
29
29
} , [ ] ) ;
30
30
Original file line number Diff line number Diff line change @@ -47,38 +47,40 @@ const AnnouncementBanner = ({
47
47
: ( ) => setAnimateOut ( true ) ;
48
48
49
49
return isShown ? (
50
- < div
51
- className = { classNames (
52
- styles . wrapper ,
53
- { [ styles . in ] : animateIn && ! animateOut } ,
54
- { [ styles . out ] : animateOut } ,
55
- ) }
56
- onTransitionEnd = { isMobile ? undefined : onTransitionEndHandler }
57
- >
58
- < div className = { styles . backgroundPatternWrapper } >
59
- < Pattern />
60
- < Pattern />
61
- </ div >
62
- < div className = { 'container' } >
63
- < div className = { styles . inner } >
64
- < p className = { styles . message } > { text } </ p >
65
- < Button
66
- tag = "a"
67
- rel = "noreferrer"
68
- href = { link }
69
- className = { styles . btn }
70
- size = { 'sm' }
71
- onClick = { readMoreButtonClickHandler }
72
- >
73
- { buttonText }
74
- </ Button >
50
+ < div style = { { height : isMobile ? 'auto' : '60px' } } >
51
+ < div
52
+ className = { classNames (
53
+ styles . wrapper ,
54
+ { [ styles . in ] : animateIn && ! animateOut } ,
55
+ { [ styles . out ] : animateOut } ,
56
+ ) }
57
+ onTransitionEnd = { isMobile ? undefined : onTransitionEndHandler }
58
+ >
59
+ < div className = { styles . backgroundPatternWrapper } >
60
+ < Pattern />
61
+ < Pattern />
62
+ </ div >
63
+ < div className = { 'container' } >
64
+ < div className = { styles . inner } >
65
+ < p className = { styles . message } > { text } </ p >
66
+ < Button
67
+ tag = "a"
68
+ rel = "noreferrer"
69
+ href = { link }
70
+ className = { styles . btn }
71
+ size = { 'sm' }
72
+ onClick = { readMoreButtonClickHandler }
73
+ >
74
+ { buttonText }
75
+ </ Button >
76
+ </ div >
75
77
</ div >
78
+ < button
79
+ type = "button"
80
+ className = { styles . btnClose }
81
+ onClick = { onCloseButtonClick }
82
+ />
76
83
</ div >
77
- < button
78
- type = "button"
79
- className = { styles . btnClose }
80
- onClick = { onCloseButtonClick }
81
- />
82
84
</ div >
83
85
) : null ;
84
86
} ;
You can’t perform that action at this time.
0 commit comments