Skip to content

Commit

Permalink
Merge pull request #43 from babylonlabs-io/fix-dackdrop
Browse files Browse the repository at this point in the history
fix: add className prop to backdrop
  • Loading branch information
totraev authored Nov 25, 2024
2 parents 138946e + eaa9f75 commit 3d49b6b
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 3d49b6b

Please sign in to comment.