* Batch edit from the current page * Redirect to grid when batch editing a page without grid * Always clear selected ids on path change * Only clear ids when selecting * Use data-photo-grid to find grid * Update batch edit from command K * Not mount batch edit panel when not needed * Not clear selecting state when go to /grid * Use search param to force batch editing
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { INFINITE_SCROLL_GRID_MULTIPLE } from '.';
|
|
import InfinitePhotoScroll from './InfinitePhotoScroll';
|
|
import PhotoGrid from './PhotoGrid';
|
|
import { ComponentProps } from 'react';
|
|
import { SortBy } from './sort';
|
|
|
|
export default function PhotoGridInfinite({
|
|
cacheKey,
|
|
initialOffset,
|
|
sortBy,
|
|
sortWithPriority,
|
|
excludeFromFeeds,
|
|
canStart,
|
|
animateOnFirstLoadOnly,
|
|
...categories
|
|
}: {
|
|
cacheKey: string
|
|
initialOffset: number
|
|
sortBy?: SortBy
|
|
sortWithPriority?: boolean
|
|
excludeFromFeeds?: boolean
|
|
} & Omit<ComponentProps<typeof PhotoGrid>, 'photos'>) {
|
|
return (
|
|
<InfinitePhotoScroll
|
|
cacheKey={cacheKey}
|
|
initialOffset={initialOffset}
|
|
itemsPerPage={INFINITE_SCROLL_GRID_MULTIPLE}
|
|
sortBy={sortBy}
|
|
sortWithPriority={sortWithPriority}
|
|
excludeFromFeeds={excludeFromFeeds}
|
|
{...categories}
|
|
>
|
|
{({ photos, onLastPhotoVisible }) =>
|
|
<PhotoGrid {...{
|
|
photos,
|
|
...categories,
|
|
canStart,
|
|
onLastPhotoVisible,
|
|
animateOnFirstLoadOnly,
|
|
}} />}
|
|
</InfinitePhotoScroll>
|
|
);
|
|
}
|