File tree Expand file tree Collapse file tree 3 files changed +20
-42
lines changed Expand file tree Collapse file tree 3 files changed +20
-42
lines changed Original file line number Diff line number Diff line change 1
- import React from "react"
2
- import { Center , FlexProps , useMediaQuery } from "@chakra-ui/react"
3
-
4
- import { lightTheme as oldTheme } from "../../theme"
5
-
6
- export type BannerNotificationProps = FlexProps & {
1
+ export type BannerNotificationProps = React . HTMLAttributes < HTMLDivElement > & {
7
2
shouldShow ?: boolean
8
3
}
9
4
10
5
const BannerNotification = ( {
11
6
children,
12
- shouldShow = false ,
7
+ shouldShow,
13
8
...props
14
9
} : BannerNotificationProps ) => {
15
- const [ isLGScreen ] = useMediaQuery ( `min-width: ${ oldTheme . breakpoints . l } ` )
10
+ if ( ! shouldShow ) return < > </ >
16
11
return (
17
- < >
18
- { shouldShow && (
19
- < Center
20
- as = "aside"
21
- maxW = { isLGScreen ? oldTheme . variables . maxPageWidth : "100%" }
22
- w = "100%"
23
- py = "4"
24
- px = "8"
25
- bg = "primary.base"
26
- color = "background.base"
27
- sx = { {
28
- a : {
29
- color : "background.base" ,
30
- } ,
31
- } }
32
- { ...props }
33
- >
34
- { children }
35
- </ Center >
36
- ) }
37
- </ >
12
+ < aside
13
+ className = "flex items-center justify-center gap-2 bg-primary-action px-8 py-4 text-white [&_a]:text-white [&_a]:hover:text-white/80"
14
+ { ...props }
15
+ >
16
+ { children }
17
+ </ aside >
38
18
)
39
19
}
40
20
Original file line number Diff line number Diff line change 1
- // Libraries
2
- import React , { useEffect , useState } from "react"
3
- import { Center , CloseButton } from "@chakra-ui/react"
1
+ import { useEffect , useState } from "react"
2
+ import { MdClose } from "react-icons/md"
3
+
4
+ import { Button } from "@/components/ui/buttons/Button"
5
+ import { Center } from "@/components/ui/flex"
4
6
5
- // Components
6
7
import BannerNotification from "../BannerNotification"
7
8
8
- // Interface
9
9
export type DismissableBannerProps = {
10
10
children : JSX . Element
11
11
storageKey : string
@@ -28,13 +28,11 @@ const DismissableBanner = ({
28
28
}
29
29
30
30
return (
31
- < BannerNotification shouldShow = { show } gap = "8" >
32
- < Center marginInlineStart = "auto" > { children } </ Center >
33
- < CloseButton
34
- marginInlineStart = "auto"
35
- onClick = { onClose }
36
- aria-label = "Close Banner"
37
- />
31
+ < BannerNotification shouldShow = { show } className = "gap-8" >
32
+ < Center className = "ms-auto" > { children } </ Center >
33
+ < Button className = "ms-auto" onClick = { onClose } aria-label = "Close Banner" >
34
+ < MdClose />
35
+ </ Button >
38
36
</ BannerNotification >
39
37
)
40
38
}
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ export const UseCasesLayout = ({
177
177
width = "full"
178
178
dir = { contentNotTranslated ? "ltr" : "unset" }
179
179
>
180
- < BannerNotification shouldShow zIndex = " sticky" hideBelow = { lgBp } >
180
+ < BannerNotification shouldShow className = "z- sticky max-lg:hidden" >
181
181
< Emoji text = ":pencil:" className = "me-4 shrink-0 text-2xl" />
182
182
< Text m = { 0 } >
183
183
{ t ( "template-usecase:template-usecase-banner" ) } { " " }
You can’t perform that action at this time.
0 commit comments