mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +01:00
28 lines
726 B
Markdown
28 lines
726 B
Markdown
|
Bootstrap modal component.
|
||
|
|
||
|
I have no idea why example doesn't work here but you can investigate HTML code...
|
||
|
```js
|
||
|
import {ModalHeader, ModalBody, ModalFooter} from './Modal';
|
||
|
|
||
|
import {useState} from 'react';
|
||
|
const [shown, setShown] = useState(false);
|
||
|
|
||
|
<>
|
||
|
<Modal shown={shown}>
|
||
|
<ModalHeader setShown={setShown} title='Warning!'/>
|
||
|
<ModalBody><p>Bla bla bla...</p></ModalBody>
|
||
|
<ModalFooter>
|
||
|
<button
|
||
|
className='btn btn-secondary'
|
||
|
onClick={() => setShown(false)}
|
||
|
>Skip it</button>
|
||
|
</ModalFooter>
|
||
|
</Modal>
|
||
|
|
||
|
<button
|
||
|
className='btn btn-secondary'
|
||
|
onClick={()=>setShown(true)}
|
||
|
>Show modal</button>
|
||
|
</>
|
||
|
```
|