Skip to content

Commit

Permalink
Merge pull request #11 from bootwindproject/fix/modal
Browse files Browse the repository at this point in the history
fix: modal
  • Loading branch information
syauqi authored Dec 2, 2023
2 parents 959767d + 5a73cb7 commit f30fd01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/modal/src/lib/ModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const ModalContent = ({ isOpen = false, ...props }: ModalContentProps) =>
return (
createPortal(
(
<div className={cn("fixed inset-0 transition duration-200 [&:not(.show)]:opacity-0 [&:is(.show)]:opacity-100 [&:not(.show)]:invisible [&:is(.show)]:visible [&:is(.show)]:transition [&:is(.show)_.modal]:top-24 ", isOpen ? 'show' : '')}>
<div className={cn("fixed inset-0 transition duration-200 px-5 pb-5 overflow-auto [&:not(.show)]:opacity-0 [&:is(.show)]:opacity-100 [&:not(.show)]:invisible [&:is(.show)]:visible [&:is(.show)]:transition [&:is(.show)_.modal]:top-24 ", isOpen ? 'show' : '')}>
<div className="relative">
<div className="modal z-[100] top-20 bg-white absolute max-w-[600px] w-full mx-5 left-1/2 -translate-x-1/2 rounded-md">
<div className="modal z-[100] top-20 bg-white absolute max-w-[600px] w-full left-1/2 -translate-x-1/2 rounded-md">
{props.children}
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion packages/modal/src/stories/modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const Basic = () => {
<ModalTitle>Sign In</ModalTitle>
</ModalHeader>
<ModalBody>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe mollitia a, molestiae soluta cupiditate consequuntur ullam voluptates, commodi magnam unde amet similique quae! Nostrum ducimus veniam sed labore praesentium molestias.
<p className='mb-5'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe mollitia a, molestiae soluta cupiditate consequuntur ullam voluptates, commodi magnam unde amet similique quae! Nostrum ducimus veniam sed labore praesentium molestias.</p>
<p className='mb-5'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe mollitia a, molestiae soluta cupiditate consequuntur ullam voluptates, commodi magnam unde amet similique quae! Nostrum ducimus veniam sed labore praesentium molestias.</p>
<p className='mb-5'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe mollitia a, molestiae soluta cupiditate consequuntur ullam voluptates, commodi magnam unde amet similique quae! Nostrum ducimus veniam sed labore praesentium molestias.</p>
</ModalBody>
<ModalFooter>
<Button onClick={() => setIsOpen(false)}>Close</Button>
Expand Down

0 comments on commit f30fd01

Please sign in to comment.