feat(shared): Modal for all MDX and Strapi content
This commit is contained in:
parent
39dd5ebaa2
commit
0b40f6f347
9 changed files with 84 additions and 42 deletions
27
packages/freesewing.shared/components/modal.js
Normal file
27
packages/freesewing.shared/components/modal.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { useState } from 'react'
|
||||
|
||||
const Modal = ({ cancel, children }) => {
|
||||
|
||||
const [ modal, setModal ] = useState(false)
|
||||
|
||||
if (modal) return (
|
||||
<div className={`
|
||||
fixed top-0 left-0 right-0 w-screen h-screen
|
||||
bg-base-100 bg-opacity-90 z-30
|
||||
hover:cursor-zoom-out flex flex-col justify-center
|
||||
`} onClick={() => setModal(false)}>
|
||||
<div className="p-8 max-h-full max-w-full">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={() => setModal(!modal)}
|
||||
className="hover:cursor-zoom-in"
|
||||
>{children}</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Modal
|
Loading…
Add table
Add a link
Reference in a new issue