Skip to content

Commit

Permalink
fix: add className prop to backdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
totraev committed Nov 25, 2024
1 parent f9dd1cf commit eaa9f75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thin-spies-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@babylonlabs-io/bbn-core-ui": patch
---

add className prop to backdrop
4 changes: 3 additions & 1 deletion src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface DialogProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEle
open?: boolean;
onClose?: () => void;
hasBackdrop?: boolean;
backdropClassName?: string;
}

export const Dialog = ({
Expand All @@ -17,6 +18,7 @@ export const Dialog = ({
className,
onClose,
hasBackdrop = true,
backdropClassName,
...restProps
}: DialogProps) => {
const { mounted, unmount } = useModalManager({ open });
Expand All @@ -32,7 +34,7 @@ export const Dialog = ({
</div>
</div>

{hasBackdrop && <Backdrop open={open} onClick={onClose} />}
{hasBackdrop && <Backdrop className={backdropClassName} open={open} onClick={onClose} />}
</Portal>
);
};

0 comments on commit eaa9f75

Please sign in to comment.