1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Release 0.1.0

This commit is contained in:
Maciej Lenartowicz
2019-10-07 15:16:27 +00:00
parent 9e965bdcef
commit 50a1bfd9b5
38 changed files with 2651 additions and 518 deletions

View File

@ -1,6 +1,13 @@
Bootstrap modal component.
I have no idea why example doesn't work here but you can investigate HTML code...
it's required to have an element `<div id={"modal-container"}/>` somewhere on the page since modals are rendered in portals.
```js
<div id="modal-container"/>
```
I have no idea why example doesn't work here but you can investigate HTML code and Foris project.
```js
import {ModalHeader, ModalBody, ModalFooter} from './Modal';
@ -8,7 +15,7 @@ import {useState} from 'react';
const [shown, setShown] = useState(false);
<>
<Modal shown={shown}>
<Modal setShown={setShown} shown={shown}>
<ModalHeader setShown={setShown} title='Warning!'/>
<ModalBody><p>Bla bla bla...</p></ModalBody>
<ModalFooter>
@ -19,9 +26,8 @@ const [shown, setShown] = useState(false);
</ModalFooter>
</Modal>
<button
className='btn btn-secondary'
onClick={()=>setShown(true)}
>Show modal</button>
<button className='btn btn-secondary' onClick={()=>setShown(true)}>
Show modal
</button>
</>
```