stacker.news/components/info.js

23 lines
590 B
JavaScript
Raw Normal View History

2022-04-18 16:08:58 +00:00
import { useState } from 'react'
import { Modal } from 'react-bootstrap'
import InfoIcon from '../svgs/information-fill.svg'
export default function Info ({ children }) {
const [info, setInfo] = useState()
return (
<>
<Modal
show={info}
onHide={() => setInfo(false)}
>
<div className='modal-close' onClick={() => setInfo(false)}>X</div>
<Modal.Body>
{children}
</Modal.Body>
</Modal>
<InfoIcon width={18} height={18} className='fill-theme-color pointer ml-1' onClick={() => setInfo(true)} />
</>
)
}