Update README, overlayFactory example (#997)

Update example of usage `overlayFactory` according to "react-loading-overlay" documentation.
This commit is contained in:
Gena M 2019-07-13 08:57:03 +03:00 committed by Allen
parent 5e8bb3426a
commit 46258b0264
2 changed files with 16 additions and 4 deletions

View File

@ -98,7 +98,14 @@ import overlayFactory from 'react-bootstrap-table2-overlay';
Actually, `react-bootstrap-table-overlay` is depends on [`react-loading-overlay`](https://github.com/derrickpelletier/react-loading-overlay) and `overlayFactory` just a factory function and you can pass any props which available for `react-loading-overlay`:
```js
overlay={ overlayFactory({ spinner: true, background: 'rgba(192,192,192,0.3)' }) }
overlay={
overlayFactory({
spinner: true,
styles: {
overlay: (base) => ({...base, background: 'rgba(255, 0, 0, 0.5)'})
}
})
}
```
### <a name='caption'>caption - [String | Node]</a>
@ -334,4 +341,4 @@ handleDataChange = ({ dataSize }) => {
onDataSizeChange={ handleDataChange }
....
/>
```
```

View File

@ -36,7 +36,7 @@ const RemotePagination = ({ loading, data, page, sizePerPage, onTableChange, tot
columns={ columns }
pagination={ paginationFactory({ page, sizePerPage, totalSize }) }
onTableChange={ onTableChange }
overlay={ overlayFactory({ spinner: true, background: 'rgba(192,192,192,0.3)' }) }
overlay={ overlayFactory({ spinner: true, styles: { overlay: (base) => ({...base, background: 'rgba(255, 0, 0, 0.5)'}) } }) }
/>
<Code>{ sourceCode }</Code>
</div>
@ -101,7 +101,12 @@ const RemotePagination = ({ loading, data, page, sizePerPage, onTableChange, tot
columns={ columns }
pagination={ paginationFactory({ page, sizePerPage, totalSize }) }
onTableChange={ onTableChange }
overlay={ overlayFactory({ spinner: true, background: 'rgba(192,192,192,0.3)' }) }
overlay={
overlayFactory({
spinner: true,
styles: { overlay: base => ({ ...base, background: 'rgba(255, 0, 0, 0.5)' }) }
})
}
/>
<Code>{ sourceCode }</Code>
</div>