aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-07-05 19:01:55 +0300
committereug-vs <eug-vs@keemail.me>2020-07-05 19:01:55 +0300
commit9ed282951a9ca1cf5dcc42b3672bef9ff52509f8 (patch)
tree15b88724b594d7106de00da6f300afc43e2938f9 /src/components
parentb6d39f5efa484152eb9688489f32d73eec250922 (diff)
downloadwhich-ui-9ed282951a9ca1cf5dcc42b3672bef9ff52509f8.tar.gz
feat: support googledrive images
Diffstat (limited to 'src/components')
-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();