File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { cn } from "@/lib/utils/cn"
2
+
1
3
export type BannerNotificationProps = React . HTMLAttributes < HTMLDivElement > & {
2
4
shouldShow ?: boolean
3
5
}
4
6
5
7
const BannerNotification = ( {
6
8
children,
7
9
shouldShow,
10
+ className,
8
11
...props
9
12
} : BannerNotificationProps ) => {
10
13
if ( ! shouldShow ) return < > </ >
11
14
return (
12
15
< 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"
16
+ className = { cn (
17
+ "flex items-center justify-center gap-2 bg-primary-action px-8 py-4 text-white ring [&_a]:text-white [&_a]:hover:text-white/80" ,
18
+ className
19
+ ) }
14
20
{ ...props }
15
21
>
16
22
{ children }
Original file line number Diff line number Diff line change @@ -4,16 +4,18 @@ import { MdClose } from "react-icons/md"
4
4
import { Button } from "@/components/ui/buttons/Button"
5
5
import { Center } from "@/components/ui/flex"
6
6
7
+ import { cn } from "@/lib/utils/cn"
8
+
7
9
import BannerNotification from "../BannerNotification"
8
10
9
- export type DismissableBannerProps = {
10
- children : JSX . Element
11
+ type DismissableBannerProps = React . HTMLAttributes < HTMLDivElement > & {
11
12
storageKey : string
12
13
}
13
14
14
15
const DismissableBanner = ( {
15
16
children,
16
17
storageKey,
18
+ className,
17
19
} : DismissableBannerProps ) => {
18
20
const [ show , setShow ] = useState < boolean > ( false )
19
21
@@ -28,9 +30,14 @@ const DismissableBanner = ({
28
30
}
29
31
30
32
return (
31
- < BannerNotification shouldShow = { show } className = "gap-8" >
33
+ < BannerNotification shouldShow = { show } className = { cn ( "gap-8" , className ) } >
32
34
< Center className = "ms-auto" > { children } </ Center >
33
- < Button className = "ms-auto" onClick = { onClose } aria-label = "Close Banner" >
35
+ < Button
36
+ className = "ms-auto"
37
+ onClick = { onClose }
38
+ aria-label = "Close Banner"
39
+ variant = "ghost"
40
+ >
34
41
< MdClose />
35
42
</ Button >
36
43
</ BannerNotification >
You can’t perform that action at this time.
0 commit comments