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

@uppy/react: remove react: prefix from id & allow id as a prop #5228

Merged
merged 2 commits into from
Jun 10, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@uppy/react/src/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Dashboard<M extends Meta, B extends Body> extends Component<

installPlugin(): void {
const { uppy, ...options } = {
id: 'react:Dashboard',
inline: true,
id: 'Dashboard',
...this.props,
inline: true,
Comment on lines +54 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the possibility to override inline via props, is it on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's on purpose and documented in #5206

target: this.container,
}
uppy.use(DashboardPlugin<M, B>, options)
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/react/src/DashboardModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class DashboardModal<M extends Meta, B extends Body> extends Component<
...rest
} = this.props
const options = {
id: 'DashboardModal',
...rest,
id: 'react:DashboardModal',
inline: false,
target,
open,
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/react/src/DragDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class DragDrop<M extends Meta, B extends Body> extends Component<
}

installPlugin(): void {
const { uppy, locale, inputName, width, height, note } = this.props
const { uppy, locale, inputName, width, height, note, id } = this.props
const options = {
id: 'react:DragDrop',
id: id || 'DragDrop',
locale,
inputName,
width,
Expand Down
9 changes: 5 additions & 4 deletions packages/@uppy/react/src/FileInput.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createElement as h, Component } from 'react'
import type { UnknownPlugin, Uppy } from '@uppy/core'
import type { UIPluginOptions, UnknownPlugin, Uppy } from '@uppy/core'
import FileInputPlugin from '@uppy/file-input'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Locale } from '@uppy/utils/lib/Translator'

interface FileInputProps<M extends Meta, B extends Body> {
interface FileInputProps<M extends Meta, B extends Body>
extends UIPluginOptions {
uppy: Uppy<M, B>
locale?: Locale
pretty?: boolean
Expand Down Expand Up @@ -47,9 +48,9 @@ class FileInput<M extends Meta, B extends Body> extends Component<
}

installPlugin(): void {
const { uppy, locale, pretty, inputName } = this.props
const { uppy, locale, pretty, inputName, id } = this.props
const options = {
id: 'react:FileInput',
id: id || 'FileInput',
locale,
pretty,
inputName,
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/react/src/ProgressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class ProgressBar<M extends Meta, B extends Body> extends Component<
}

installPlugin(): void {
const { uppy, fixed, hideAfterFinish } = this.props
const { uppy, fixed, hideAfterFinish, id } = this.props
const options = {
id: 'react:ProgressBar',
id: id || 'ProgressBar',
fixed,
hideAfterFinish,
target: this.container,
Expand Down
3 changes: 2 additions & 1 deletion packages/@uppy/react/src/StatusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ class StatusBar<M extends Meta, B extends Body> extends Component<
showProgressDetails,
hideAfterFinish,
doneButtonHandler,
id,
} = this.props
const options = {
id: 'react:StatusBar',
id: id || 'StatusBar',
hideUploadButton,
hideRetryButton,
hidePauseResumeButton,
Expand Down