Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix React examples #3799

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 21 additions & 16 deletions website/src/docs/react-dragdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
}}
/>
)
}
```
17 changes: 11 additions & 6 deletions website/src/docs/react-fileinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -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[]"
/>
)
}
```
16 changes: 11 additions & 5 deletions website/src/docs/react-progressbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
18 changes: 12 additions & 6 deletions website/src/docs/react-statusbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/