Skip to content

Commit

Permalink
pull logic out from react component
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 26, 2024
1 parent 8fd3ae9 commit 7a56978
Show file tree
Hide file tree
Showing 4 changed files with 547 additions and 432 deletions.
8 changes: 2 additions & 6 deletions packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import {
tokenStorage,
} from '@uppy/companion-client'

import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import {
type PickedItem,
type PluginState,
} from '@uppy/provider-views/lib/GooglePicker/GooglePickerView.js'
import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js'

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down Expand Up @@ -66,7 +63,7 @@ export default class GoogleDrivePicker<
M extends Meta & { width: number; height: number },
B extends Body,
>
extends UIPlugin<GoogleDrivePickerOptions, M, B, PluginState>
extends UIPlugin<GoogleDrivePickerOptions, M, B>
implements BaseProviderPlugin
{
static VERSION = packageJson.version
Expand Down Expand Up @@ -144,7 +141,6 @@ export default class GoogleDrivePicker<
<GooglePickerView
storage={this.storage}
pickerType="drive"
plugin={this}
uppy={this.uppy}
clientId={this.opts.clientId}
apiKey={this.opts.apiKey}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import {
tokenStorage,
} from '@uppy/companion-client'

import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import {
type PickedItem,
type PluginState,
} from '@uppy/provider-views/lib/GooglePicker/GooglePickerView.js'
import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js'

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down Expand Up @@ -59,7 +56,7 @@ export default class GooglePhotosPicker<
M extends Meta & { width: number; height: number },
B extends Body,
>
extends UIPlugin<GooglePhotosPickerOptions, M, B, PluginState>
extends UIPlugin<GooglePhotosPickerOptions, M, B>
implements BaseProviderPlugin
{
static VERSION = packageJson.version
Expand Down Expand Up @@ -137,7 +134,6 @@ export default class GooglePhotosPicker<
<GooglePickerView
storage={this.storage}
pickerType="photos"
plugin={this}
uppy={this.uppy}
clientId={this.opts.clientId}
onFilesPicked={this.handleFilesPicked}
Expand Down
Loading

0 comments on commit 7a56978

Please sign in to comment.