Skip to content

Commit 2124080

Browse files
committed
feat: add video support
1 parent cf8d401 commit 2124080

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

pexels-grid/src/components/GalleryController.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function GalleryController({
4343
queryKey: ["gallery", page, query],
4444
queryFn: async () => {
4545
try {
46-
const API_URL = dynamicConfig?.API_URL;
46+
const API_URL = (await dynamicConfig).API_URL;
4747
let uri = query
4848
? `${API_URL}pexels/search/${query}?page=${page || 1}`
4949
: API_URL + "pexels/curated/" + page;

pexels-grid/src/components/PhotoImage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function PhotoImage({
3030
} catch (err) {
3131
console.error("err", (err as Error)?.message || err);
3232
}
33-
const API_URL = dynamicConfig?.API_URL;
33+
const API_URL = (await dynamicConfig).API_URL;
3434
const f = await fetch(API_URL + "pexels/" + photoId);
3535
return f.json();
3636
},

pexels-grid/src/utils/dynamicConfig.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22

33
import { getServerEnv } from "./getServerEnv";
44

5-
export let dynamicConfig: undefined | Awaited<ReturnType<typeof getServerEnv>> = undefined
6-
getServerEnv().then((c)=>{
7-
dynamicConfig = c
8-
})
5+
export const dynamicConfig = getServerEnv()

0 commit comments

Comments
 (0)