Skip to content
Snippets Groups Projects
Commit 2feafa14 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

docs(faraday-ui): fix markdown links

parent edae851d
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
......@@ -2,22 +2,22 @@
_Utility HOCs_
* [withCountries](#withCountries)
* [withFetching](#withFetching)
* [withFileDownload](#withFileDownload)
* [withFilePreview](#withFilePreview)
* [withPagination](#withPagination)
* [withRoles](#withRoles)
* [withZipDownload](#withZipDownload)
* [withCountries](#withcountries)
* [withFetching](#withfetching)
* [withFileDownload](#withfiledownload)
* [withFilePreview](#withfilepreview)
* [withPagination](#withpagination)
* [withRoles](#withroles)
* [withZipDownload](#withzipdownload)
_HOCs used for files drag and drop_
* [withFileSectionDrop](#withFileSectionDrop)
* [withNativeFileDrop](#withNativeFileDrop)
* [withFileSectionDrop](#withfilesectiondrop)
* [withNativeFileDrop](#withnativefiledrop)
_Utility functions_
* [handleError](#handleError)
* [handleError](#handleerror)
# Utility HOCs
......@@ -97,7 +97,7 @@ const Wrapped = ({ downloadFile }) => (
</div>
)
export default Wrapped
export default withFileDownload(Wrapped)
```
## withFilePreview
......@@ -112,6 +112,25 @@ This HOC assumes the following props are present on the wrapped component:
* `previewFile: (file: {id: string, ...}) => any`: opens the file preview in a new tab (only possible for PDF files and images)
```javascript
import { withProps } from 'recompose'
import { FileItem, withFilePreview Wrapped} from 'pubsweet-component-faraday-ui'
const file = {
id: 'myfile',
name: 'myfile.pdf',
size: 100231,
}
const Wrapped = ({ previewFile }) => (
<div>
<FileItem item={file} onPreview={previewFile} />
</div>
)
export default withFilePreview(Wrapped)
```
## withPagination
Injects `page`, `itemsPerPage`, `toFirst`, `nextPage`, `toLast`, `prevPage`, `changeItemsPerPage`, `hasMore`, `maxItems` and `paginatedItems` as props.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment