Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
2feafa14
Commit
2feafa14
authored
6 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
docs(faraday-ui): fix markdown links
parent
edae851d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!222
Sprint #26
,
!217
Sprint #26
,
!191
Hin 1116 documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/component-faraday-ui/src/helpers/helpers.md
+30
-11
30 additions, 11 deletions
packages/component-faraday-ui/src/helpers/helpers.md
with
30 additions
and
11 deletions
packages/component-faraday-ui/src/helpers/helpers.md
+
30
−
11
View file @
2feafa14
...
...
@@ -2,22 +2,22 @@
_Utility HOCs_
*
[
withCountries
](
#with
C
ountries
)
*
[
withFetching
](
#with
F
etching
)
*
[
withFileDownload
](
#with
F
ile
D
ownload
)
*
[
withFilePreview
](
#with
F
ile
P
review
)
*
[
withPagination
](
#with
P
agination
)
*
[
withRoles
](
#with
R
oles
)
*
[
withZipDownload
](
#with
Z
ip
D
ownload
)
*
[
withCountries
](
#with
c
ountries
)
*
[
withFetching
](
#with
f
etching
)
*
[
withFileDownload
](
#with
f
ile
d
ownload
)
*
[
withFilePreview
](
#with
f
ile
p
review
)
*
[
withPagination
](
#with
p
agination
)
*
[
withRoles
](
#with
r
oles
)
*
[
withZipDownload
](
#with
z
ip
d
ownload
)
_HOCs used for files drag and drop_
*
[
withFileSectionDrop
](
#with
F
ile
S
ection
D
rop
)
*
[
withNativeFileDrop
](
#with
N
ative
F
ile
D
rop
)
*
[
withFileSectionDrop
](
#with
f
ile
s
ection
d
rop
)
*
[
withNativeFileDrop
](
#with
n
ative
f
ile
d
rop
)
_Utility functions_
*
[
handleError
](
#handle
E
rror
)
*
[
handleError
](
#handle
e
rror
)
# 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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment