mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
doc: fix React examples (#3799)
This commit is contained in:
parent
588b909069
commit
6a509df10c
4 changed files with 55 additions and 33 deletions
|
|
@ -44,20 +44,25 @@ The `<DragDrop />` component supports all [DragDrop](/docs/drag-drop/) options a
|
|||
import React from 'react'
|
||||
import { DragDrop } from '@uppy/react'
|
||||
|
||||
<DragDrop
|
||||
width="100%"
|
||||
height="100%"
|
||||
note="Images up to 200×200px"
|
||||
// assuming `this.uppy` contains an Uppy instance:
|
||||
uppy={this.uppy}
|
||||
locale={{
|
||||
strings: {
|
||||
// Text to show on the droppable area.
|
||||
// `%{browse}` is replaced with a link that opens the system file selection dialog.
|
||||
dropHereOr: 'Drop here or %{browse}',
|
||||
// Used as the label for the link that opens the system file selection dialog.
|
||||
browse: 'browse',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
export default function MyComponent (props) {
|
||||
const { uppy } = props
|
||||
return (
|
||||
<DragDrop
|
||||
width="100%"
|
||||
height="100%"
|
||||
note="Images up to 200×200px"
|
||||
// assuming `props.uppy` contains an Uppy instance:
|
||||
uppy={uppy}
|
||||
locale={{
|
||||
strings: {
|
||||
// Text to show on the droppable area.
|
||||
// `%{browse}` is replaced with a link that opens the system file selection dialog.
|
||||
dropHereOr: 'Drop here or %{browse}',
|
||||
// Used as the label for the link that opens the system file selection dialog.
|
||||
browse: 'browse',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -44,10 +44,15 @@ The `<FileInput />` component supports all [FileInput](/docs/file-input/) option
|
|||
import React from 'react'
|
||||
import { FileInput } from '@uppy/react'
|
||||
|
||||
<FileInput
|
||||
// assuming `this.uppy` contains an Uppy instance:
|
||||
uppy={this.uppy}
|
||||
pretty
|
||||
inputName="files[]"
|
||||
/>
|
||||
export default function MyComponent (props) {
|
||||
const { uppy } = props
|
||||
return (
|
||||
<FileInput
|
||||
// assuming `props.uppy` contains an Uppy instance:
|
||||
uppy={uppy}
|
||||
pretty
|
||||
inputName="files[]"
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -44,11 +44,17 @@ The `<ProgressBar />` component supports all [`@uppy/progress-bar`][] options as
|
|||
import React from 'react'
|
||||
import { ProgressBar } from '@uppy/react'
|
||||
|
||||
<ProgressBar
|
||||
uppy={uppy}
|
||||
fixed
|
||||
hideAfterFinish
|
||||
/>
|
||||
export default function MyComponent (props) {
|
||||
const { uppy } = props
|
||||
return (
|
||||
<ProgressBar
|
||||
// assuming `props.uppy` contains an Uppy instance:
|
||||
uppy={uppy}
|
||||
fixed
|
||||
hideAfterFinish
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
[`@uppy/progress-bar`]: /docs/progress-bar/
|
||||
|
|
|
|||
|
|
@ -44,12 +44,18 @@ The `<StatusBar />` component supports all [`@uppy/status-bar`][] options as pro
|
|||
import React from 'react'
|
||||
import { StatusBar } from '@uppy/react'
|
||||
|
||||
<StatusBar
|
||||
uppy={uppy}
|
||||
hideUploadButton
|
||||
hideAfterFinish={false}
|
||||
showProgressDetails
|
||||
/>
|
||||
export default function MyComponent (props) {
|
||||
const { uppy } = props
|
||||
return (
|
||||
<StatusBar
|
||||
// assuming `props.uppy` contains an Uppy instance:
|
||||
uppy={uppy}
|
||||
hideUploadButton
|
||||
hideAfterFinish={false}
|
||||
showProgressDetails
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
[`@uppy/status-bar`]: /docs/status-bar/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue