Skip to content

Commit

Permalink
fix: add dialog className (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
totraev authored Dec 10, 2024
1 parent dfba841 commit 887dbe1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 58 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-walls-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@babylonlabs-io/bbn-core-ui": patch
---

fix: add dialog className
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface DialogProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEle
onClose?: () => void;
hasBackdrop?: boolean;
backdropClassName?: string;
dialogClassName?: string;
}

export const Dialog = ({
Expand All @@ -19,15 +20,16 @@ export const Dialog = ({
onClose,
hasBackdrop = true,
backdropClassName,
dialogClassName,
...restProps
}: DialogProps) => {
const { mounted, unmount } = useModalManager({ open });

return (
<Portal mounted={mounted}>
<div {...restProps} className="bbn-dialog-wrapper">
<div {...restProps} className={twJoin("bbn-dialog-wrapper", className)}>
<div
className={twJoin("bbn-dialog", open ? "animate-modal-in" : "animate-modal-out", className)}
className={twJoin("bbn-dialog", open ? "animate-modal-in" : "animate-modal-out", dialogClassName)}
onAnimationEnd={unmount}
>
{children}
Expand Down
25 changes: 0 additions & 25 deletions src/hooks/usePopperUpdate.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/hooks/usePortalRoot.ts

This file was deleted.

0 comments on commit 887dbe1

Please sign in to comment.