aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/UploadImage/UploadImage.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/UploadImage/UploadImage.tsx b/src/components/UploadImage/UploadImage.tsx
index 737c4df..e9f2168 100644
--- a/src/components/UploadImage/UploadImage.tsx
+++ b/src/components/UploadImage/UploadImage.tsx
@@ -28,6 +28,10 @@ const UploadImage: React.FC<PropTypes> = ({ setIsOpen, isOpen, callback }) => {
const appendixIndex = url.indexOf('/?utm_source=');
const baseUrl = url.slice(0, appendixIndex);
result = `${baseUrl}/media/?size=l`;
+ } else if (url.startsWith('https://drive.google.com/')) {
+ const match = url.match('/d/(.*)/');
+ const fileId = match && match[1];
+ result = `https://drive.google.com/uc?export=view&id=${fileId}`;
}
callback(result || '');
handleClose();