From 4267eafd5a565b77c4fe5342b8563c4642c319b4 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 18 Apr 2024 22:29:31 -0500 Subject: [PATCH] Disable home page animation --- src/app/page.tsx | 6 +++++- src/components/AnimateItems.tsx | 4 +++- src/photo/MorePhotosRoot.tsx | 2 +- src/photo/PhotoGrid.tsx | 1 + src/photo/PhotosLarge.tsx | 4 ++++ src/site/Nav.tsx | 11 +++++++++-- src/site/NavClient.tsx | 7 +++---- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 84999b4f..caa48fd5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -32,7 +32,11 @@ export default async function HomePage() { return ( photos.length > 0 ?
- + {items.map((item, index) =>
).concat(additionalTile ?? [])} + itemKeys={photos.map(photo => photo.id)} /> ); }; diff --git a/src/photo/PhotosLarge.tsx b/src/photo/PhotosLarge.tsx index 89550851..1c0f570d 100644 --- a/src/photo/PhotosLarge.tsx +++ b/src/photo/PhotosLarge.tsx @@ -4,14 +4,17 @@ import PhotoLarge from './PhotoLarge'; export default function PhotosLarge({ photos, + animate = true, prefetchFirstPhotoLinks, }: { photos: Photo[] + animate?: boolean prefetchFirstPhotoLinks?: boolean }) { return ( )} + itemKeys={photos.map(photo => photo.id)} /> ); } diff --git a/src/site/Nav.tsx b/src/site/Nav.tsx index 0526b141..f20874cc 100644 --- a/src/site/Nav.tsx +++ b/src/site/Nav.tsx @@ -1,9 +1,16 @@ import { authCachedSafe } from '@/auth/cache'; import NavClient from './NavClient'; -export default async function Nav() { +export default async function Nav({ + animate, +}: { + animate?: boolean +}) { const session = await authCachedSafe(); return ( - + ); } diff --git a/src/site/NavClient.tsx b/src/site/NavClient.tsx index a34d4350..d323511c 100644 --- a/src/site/NavClient.tsx +++ b/src/site/NavClient.tsx @@ -8,7 +8,6 @@ import { SITE_DOMAIN_OR_TITLE } from '@/site/config'; import ViewSwitcher, { SwitcherSelection } from '@/site/ViewSwitcher'; import { PATH_ROOT, - isPathAdmin, isPathGrid, isPathProtected, isPathSignIn, @@ -17,15 +16,15 @@ import AnimateItems from '../components/AnimateItems'; export default function NavClient({ showAdmin, + animate, }: { showAdmin?: boolean, + animate?: boolean, }) { const pathname = usePathname(); const showNav = !isPathSignIn(pathname); - const shouldAnimate = !isPathAdmin(pathname); - const renderLink = ( text: string, linkOrAction: string | (() => void), @@ -49,7 +48,7 @@ export default function NavClient({ contentMain={