mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added Modal
This commit is contained in:
parent
165bfa203c
commit
537c8af6a8
36
components/Modal.tsx
Normal file
36
components/Modal.tsx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { ReactNode } from 'react'
|
||||||
|
import { Modal as ReactModal} from 'react-responsive-modal'
|
||||||
|
import 'react-responsive-modal/styles.css'
|
||||||
|
|
||||||
|
const Modal = ({ children, isOpen, onClose, dark, header }:ModalProps):JSX.Element => {
|
||||||
|
return <ReactModal open={isOpen} onClose={onClose} center animationDuration={100} classNames={{
|
||||||
|
modal: 'bg-discord-dark'
|
||||||
|
}}
|
||||||
|
showCloseIcon={false}
|
||||||
|
styles={{
|
||||||
|
modal: {
|
||||||
|
borderRadius: '10px',
|
||||||
|
background: dark ? '#2C2F33' : '#fbfbfb',
|
||||||
|
color: dark ? 'white' : 'black',
|
||||||
|
minWidth: '500px'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<h2 className='text-lg font-black uppercase'>{header}</h2>
|
||||||
|
<div className='pt-4 relative'>
|
||||||
|
<div>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ReactModal>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModalProps {
|
||||||
|
dark: boolean
|
||||||
|
isOpen: boolean
|
||||||
|
header?: string
|
||||||
|
children: ReactNode
|
||||||
|
onClose(): void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Modal
|
||||||
Loading…
x
Reference in New Issue
Block a user