From 9a1ee3f95a55a71c22f9888c8b26613126bc398d Mon Sep 17 00:00:00 2001 From: Merlijn Vos Date: Thu, 11 Jul 2024 12:44:33 +0200 Subject: [PATCH] Add Google Photos to example (#259) Co-authored-by: Antoine du Hamel Co-authored-by: Antoine du Hamel --- package.json | 1 + src/pages/examples.module.css | 4 ---- src/pages/examples.tsx | 12 ++++++++++++ yarn.lock | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3b4e2ef13..0013b31dd 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@uppy/dropbox": "latest", "@uppy/golden-retriever": "latest", "@uppy/google-drive": "latest", + "@uppy/google-photos": "latest", "@uppy/image-editor": "latest", "@uppy/instagram": "latest", "@uppy/locales": "latest", diff --git a/src/pages/examples.module.css b/src/pages/examples.module.css index 2b6955721..0ca4bab35 100644 --- a/src/pages/examples.module.css +++ b/src/pages/examples.module.css @@ -28,10 +28,6 @@ accent-color: #f37; } -.main input[type='checkbox']:not(:checked) + label { - color: gray; -} - .main input[type='checkbox']:not(:checked, :disabled):hover + label { color: black; } diff --git a/src/pages/examples.tsx b/src/pages/examples.tsx index c75359097..300d70d6f 100644 --- a/src/pages/examples.tsx +++ b/src/pages/examples.tsx @@ -8,6 +8,7 @@ import Dashboard from '@uppy/react/lib/Dashboard'; import UppyCore from '@uppy/core'; import Webcam from '@uppy/webcam'; import GoogleDrive from '@uppy/google-drive'; +import GooglePhotos from '@uppy/google-photos'; import Instagram from '@uppy/instagram'; import Dropbox from '@uppy/dropbox'; import OneDrive from '@uppy/onedrive'; @@ -61,6 +62,7 @@ const initialState: State = { plugins: [ 'Webcam', 'GoogleDrive', + 'GooglePhotos', 'Dropbox', 'Url', 'OneDrive', @@ -105,6 +107,11 @@ const options = [ value: 'GoogleDrive', type: 'plugins', }, + { + label: 'Google Photos', + value: 'GooglePhotos', + type: 'plugins', + }, { label: 'Dropbox', value: 'Dropbox', @@ -221,6 +228,11 @@ const Uppy = ({ state, locale }) => { }, }); } + if (state.plugins.includes('GooglePhotos')) { + uppy.use(GooglePhotos, { + companionUrl, + }); + } if (state.plugins.includes('Dropbox')) { uppy.use(Dropbox, { companionUrl }); } diff --git a/yarn.lock b/yarn.lock index 31dce448e..5c28debb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3745,7 +3745,7 @@ __metadata: languageName: node linkType: hard -"@uppy/google-photos@npm:^0.2.0": +"@uppy/google-photos@npm:^0.2.0, @uppy/google-photos@npm:latest": version: 0.2.0 resolution: "@uppy/google-photos@npm:0.2.0" dependencies: @@ -16086,6 +16086,7 @@ __metadata: "@uppy/dropbox": "npm:latest" "@uppy/golden-retriever": "npm:latest" "@uppy/google-drive": "npm:latest" + "@uppy/google-photos": "npm:latest" "@uppy/image-editor": "npm:latest" "@uppy/instagram": "npm:latest" "@uppy/locales": "npm:latest"