From bb75df48324e1df3d7464084cca0f583f82d9b35 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 22 Jan 2024 20:06:12 -0600 Subject: [PATCH] Temporarily simplify static page generation --- src/app/p/[photoId]/layout.tsx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/app/p/[photoId]/layout.tsx b/src/app/p/[photoId]/layout.tsx index 87370443..680d87d3 100644 --- a/src/app/p/[photoId]/layout.tsx +++ b/src/app/p/[photoId]/layout.tsx @@ -1,5 +1,5 @@ import { - GRID_THUMBNAILS_TO_SHOW_MAX, + // GRID_THUMBNAILS_TO_SHOW_MAX, descriptionForPhoto, titleForPhoto, } from '@/photo'; @@ -13,7 +13,7 @@ import { import PhotoDetailPage from '@/photo/PhotoDetailPage'; import { getPhotoCached, - getPhotosNearIdCached, + // getPhotosNearIdCached, } from '@/cache'; import { getPhotoIds } from '@/services/vercel-postgres'; @@ -60,28 +60,31 @@ export default async function PhotoPage({ params: { photoId }, children, }: PhotoProps & { children: React.ReactNode }) { - const photos = await getPhotosNearIdCached( - photoId, - GRID_THUMBNAILS_TO_SHOW_MAX + 2, - ); + // const photos = await getPhotosNearIdCached( + // photoId, + // GRID_THUMBNAILS_TO_SHOW_MAX + 2, + // ); - const photo = photos.find(p => p.id === photoId); + const photo = await getPhotoCached(photoId); + + // const photo = photos.find(p => p.id === photoId); if (!photo) { redirect(PATH_ROOT); } - const isPhotoFirst = photos.findIndex(p => p.id === photoId) === 0; + // const isPhotoFirst = photos.findIndex(p => p.id === photoId) === 0; return <> {children} ; }