Rename home constant
This commit is contained in:
parent
6e90eda992
commit
31e5e263cf
@ -1,6 +1,6 @@
|
|||||||
import { getPhotosCached, getPhotosCountCached } from '@/photo/cache';
|
import { getPhotosCached, getPhotosCountCached } from '@/photo/cache';
|
||||||
import {
|
import {
|
||||||
INFINITE_SCROLL_MULTIPLE_ROOT,
|
INFINITE_SCROLL_MULTIPLE_HOME,
|
||||||
generateOgImageMetaForPhotos,
|
generateOgImageMetaForPhotos,
|
||||||
} from '@/photo';
|
} from '@/photo';
|
||||||
import PhotosEmptyState from '@/photo/PhotosEmptyState';
|
import PhotosEmptyState from '@/photo/PhotosEmptyState';
|
||||||
@ -25,7 +25,7 @@ export default async function HomePage() {
|
|||||||
count,
|
count,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
// Make homepage queries resilient to error on first time setup
|
// Make homepage queries resilient to error on first time setup
|
||||||
getPhotosCached({ limit: INFINITE_SCROLL_MULTIPLE_ROOT }).catch(() => []),
|
getPhotosCached({ limit: INFINITE_SCROLL_MULTIPLE_HOME }).catch(() => []),
|
||||||
getPhotosCountCached().catch(() => 0),
|
getPhotosCountCached().catch(() => 0),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ export default async function HomePage() {
|
|||||||
<PhotosLarge photos={photos} />
|
<PhotosLarge photos={photos} />
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<MorePhotosRoot
|
<MorePhotosRoot
|
||||||
initialOffset={INFINITE_SCROLL_MULTIPLE_ROOT}
|
initialOffset={INFINITE_SCROLL_MULTIPLE_HOME}
|
||||||
itemsPerRequest={INFINITE_SCROLL_MULTIPLE_ROOT}
|
itemsPerRequest={INFINITE_SCROLL_MULTIPLE_HOME}
|
||||||
totalPhotosCount={count}
|
totalPhotosCount={count}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import type { Metadata } from 'next';
|
|||||||
|
|
||||||
export const GENERATE_STATIC_PARAMS_LIMIT = 1000;
|
export const GENERATE_STATIC_PARAMS_LIMIT = 1000;
|
||||||
|
|
||||||
export const INFINITE_SCROLL_MULTIPLE_ROOT =
|
export const INFINITE_SCROLL_MULTIPLE_HOME =
|
||||||
process.env.NODE_ENV === 'development' ? 2 : 12;
|
process.env.NODE_ENV === 'development' ? 2 : 12;
|
||||||
export const INFINITE_SCROLL_MULTIPLE_GRID = HIGH_DENSITY_GRID
|
export const INFINITE_SCROLL_MULTIPLE_GRID = HIGH_DENSITY_GRID
|
||||||
? process.env.NODE_ENV === 'development' ? 4 : 20
|
? process.env.NODE_ENV === 'development' ? 4 : 20
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user