Skip to content

Commit 0b9b899

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

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pexels-grid/src/app/videos/@videomodal/p/[id]/page.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default async function PhotoPage({
99
const p = await params;
1010
return (
1111
<StorageWrapper>
12-
<PhotoImage photoId={p.id} video={true} />
12+
<div>
13+
<PhotoImage photoId={p.id} video={true} />
14+
</div>
1315
</StorageWrapper>
1416
);
1517
}

pexels-grid/src/components/PhotoImage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ import { Button } from "@headlessui/react";
44
import { useQuery } from "@tanstack/react-query";
55
import { useAppSelector } from "@/store/hooks";
66
import { Photo, Video } from "pexels";
7-
import { dynamicConfig } from "@/utils/dynamicConfig";
87

98
export default function PhotoImage({
109
photoId,
1110
photo: photoSSR,
1211
video,
12+
API_URL
1313
}: {
1414
photoId: string;
1515
photo?: Photo;
1616
video?: boolean;
17+
API_URL:string;
1718
}) {
1819
const router = useRouter();
1920
const goBack = () => router.back();
@@ -30,7 +31,6 @@ export default function PhotoImage({
3031
} catch (err) {
3132
console.error("err", (err as Error)?.message || err);
3233
}
33-
const API_URL = (await dynamicConfig).API_URL;
3434
const f = await fetch(API_URL + "pexels/" + photoId);
3535
return f.json();
3636
},

0 commit comments

Comments
 (0)