Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions starters/tailwind/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,26 @@ const modalStyles = tv({
}
});

export function Modal(props: ModalOverlayProps) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that the type specified here is ModalOverlayProps, I think we can just stop passing the props to the RACModal?

export function Modal({children, ...props}: ModalOverlayProps) {
let {
isDismissable,
isKeyboardDismissDisabled,
isOpen,
defaultOpen,
onOpenChange,
isEntering,
isExiting,
UNSTABLE_portalContainer,
shouldCloseOnInteractOutside,
...modalProps
} = props;

return (
<ModalOverlay {...props} className={overlayStyles}>
<div className="sticky top-0 left-0 w-full h-(--visual-viewport-height) flex items-center justify-center box-border">
<RACModal {...props} className={modalStyles} />
<RACModal {...modalProps} className={modalStyles}>
Comment on lines -34 to +47
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does this cause some issue I'm not thinking of?
<RACModal className={modalStyles}>

{children}
</RACModal>
</div>
</ModalOverlay>
);
Expand Down
Loading