We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f45942 commit 6bf2cc5Copy full SHA for 6bf2cc5
1 file changed
src/pages/committee.js
@@ -10,10 +10,19 @@ const safeArray = (data) => (Array.isArray(data) ? data : []);
10
11
const get = (obj, key) => safeArray(obj?.data?.[key]);
12
13
+// function toGoogleImageUrl(url = "") {
14
+// const match = url.match(/id=([^&]+)/);
15
+// if (!match) return url;
16
+// return `https://lh3.googleusercontent.com/d/${match[1]}=w500`;
17
+// }
18
function toGoogleImageUrl(url = "") {
- const match = url.match(/id=([^&]+)/);
- if (!match) return url;
- return `https://lh3.googleusercontent.com/d/${match[1]}=w500`;
19
+ const fileId =
20
+ url.match(/\/d\/([^/]+)/)?.[1] ||
21
+ url.match(/id=([^&]+)/)?.[1];
22
+
23
+ if (!fileId) return url;
24
25
+ return `https://drive.google.com/uc?export=view&id=${fileId}`;
26
}
27
28
// -----------------------------
0 commit comments