Skip to content

Commit 324c3b2

Browse files
committed
fix: pass className through
1 parent 4a273e8 commit 324c3b2

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/components/Banners/BannerNotification.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
import { cn } from "@/lib/utils/cn"
2+
13
export type BannerNotificationProps = React.HTMLAttributes<HTMLDivElement> & {
24
shouldShow?: boolean
35
}
46

57
const BannerNotification = ({
68
children,
79
shouldShow,
10+
className,
811
...props
912
}: BannerNotificationProps) => {
1013
if (!shouldShow) return <></>
1114
return (
1215
<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+
)}
1420
{...props}
1521
>
1622
{children}

src/components/Banners/DismissableBanner/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import { MdClose } from "react-icons/md"
44
import { Button } from "@/components/ui/buttons/Button"
55
import { Center } from "@/components/ui/flex"
66

7+
import { cn } from "@/lib/utils/cn"
8+
79
import BannerNotification from "../BannerNotification"
810

9-
export type DismissableBannerProps = {
10-
children: JSX.Element
11+
type DismissableBannerProps = React.HTMLAttributes<HTMLDivElement> & {
1112
storageKey: string
1213
}
1314

1415
const DismissableBanner = ({
1516
children,
1617
storageKey,
18+
className,
1719
}: DismissableBannerProps) => {
1820
const [show, setShow] = useState<boolean>(false)
1921

@@ -28,9 +30,14 @@ const DismissableBanner = ({
2830
}
2931

3032
return (
31-
<BannerNotification shouldShow={show} className="gap-8">
33+
<BannerNotification shouldShow={show} className={cn("gap-8", className)}>
3234
<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+
>
3441
<MdClose />
3542
</Button>
3643
</BannerNotification>

0 commit comments

Comments
 (0)