File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { Center , Flex , Text , chakra } from '@chakra-ui/react'
2
+ import { CloseIcon } from '@chakra-ui/icons'
2
3
3
4
const Banner = ( ) => {
5
+ const dismissBanner = ( ) => {
6
+ localStorage . setItem ( 'bannerDismissed' , 'true' )
7
+ const banner = document . getElementById ( 'banner' )
8
+ if ( banner ) {
9
+ banner . style . display = 'none'
10
+ }
11
+ }
12
+
4
13
return (
5
14
< Center
6
15
py = "2"
7
16
px = "3"
8
17
bgGradient = "linear(to-r,cyan.700, purple.500)"
9
18
color = "white"
10
19
textAlign = "center"
20
+ id = "banner"
11
21
>
12
22
< Flex align = "center" fontSize = "sm" >
13
23
< Text fontWeight = "medium" maxW = { { base : '32ch' , md : 'unset' } } >
@@ -28,6 +38,17 @@ const Banner = () => {
28
38
>
29
39
Subscribe now!{ ' ' }
30
40
</ chakra . a >
41
+ < chakra . button
42
+ onClick = { dismissBanner }
43
+ ms = "6"
44
+ color = "whiteAlpha.900"
45
+ fontWeight = "semibold"
46
+ px = "3"
47
+ py = "1"
48
+ rounded = "base"
49
+ >
50
+ < CloseIcon />
51
+ </ chakra . button >
31
52
</ Flex >
32
53
</ Center >
33
54
)
You can’t perform that action at this time.
0 commit comments