diff --git a/app/admin/recipe/[photoId]/page.tsx b/app/admin/recipe/[photoId]/page.tsx deleted file mode 100644 index 322a140a..00000000 --- a/app/admin/recipe/[photoId]/page.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import SiteGrid from '@/components/SiteGrid'; -import { getPhoto, getPhotos } from '@/photo/db/query'; -import PhotoRecipeOverlay from '@/photo/PhotoRecipeOverlay'; - -export default async function AdminRecipePage({ - params, -}: { - params: Promise<{ photoId: string }> -}) { - const { photoId } = await params; - const photo = await getPhoto(photoId); - const photosHidden = await getPhotos({ hidden: 'only' }); - const { filmSimulation } = photo!; - const { fujifilmRecipe } = photosHidden[0]; - - return ( - - :
- Can't find photo/recipe -
} - /> - ); -} diff --git a/app/admin/recipe/page.tsx b/app/admin/recipe/page.tsx deleted file mode 100644 index 5329b230..00000000 --- a/app/admin/recipe/page.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { getPhoto, getPhotos } from '@/photo/db/query'; -import PhotoRecipeOverlay from '@/photo/PhotoRecipeOverlay'; - -export default async function AdminRecipePage() { - const [ - photos, - photo1, - photo2, - photo3, - photo4, - photosHidden, - ] = await Promise.all([ - getPhotos({ tag: 'favs' }), - getPhoto('4zT6dgPr'), - getPhoto('9MopluBn'), - getPhoto('ifv8zq45'), - getPhoto('2BO2YoW6'), - getPhotos({ hidden: 'only', limit: 1 }), - ]); - const { fujifilmRecipe } = photosHidden[0]; - return ( - - ); -} diff --git a/app/film/[simulation]/page.tsx b/app/film/[simulation]/page.tsx index a941adb7..ec6e74b6 100644 --- a/app/film/[simulation]/page.tsx +++ b/app/film/[simulation]/page.tsx @@ -7,6 +7,8 @@ import { getPhotosFilmSimulationDataCached } from '@/simulation/data'; import { STATICALLY_OPTIMIZED_PHOTO_CATEGORIES } from '@/app/config'; import { Metadata } from 'next/types'; import { cache } from 'react'; +import { PATH_ROOT } from '@/app/paths'; +import { redirect } from 'next/navigation'; const getPhotosFilmSimulationDataCachedCached = cache(getPhotosFilmSimulationDataCached); @@ -38,6 +40,8 @@ export async function generateMetadata({ limit: INFINITE_SCROLL_GRID_INITIAL, }); + if (photos.length === 0) { return {}; } + const { url, title, @@ -75,6 +79,8 @@ export default async function FilmSimulationPage({ limit: INFINITE_SCROLL_GRID_INITIAL, }); + if (photos.length === 0) { redirect(PATH_ROOT); } + return ( []), @@ -40,7 +41,7 @@ export default async function GridPage() { return ( photos.length > 0 ? : ); diff --git a/app/layout.tsx b/app/layout.tsx index b4f37c38..60efe2c7 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -22,6 +22,7 @@ import AdminBatchEditPanel from '@/admin/AdminBatchEditPanel'; import ShareModals from '@/share/ShareModals'; import AdminUploadPanel from '@/admin/upload/AdminUploadPanel'; import { revalidatePath } from 'next/cache'; +import RecipeModal from '@/recipe/RecipeModal'; import '../tailwind.css'; @@ -86,6 +87,7 @@ export default function RootLayout({ )}>