Skip to content

Commit e7cda1f

Browse files
committed
add comment for initial page
1 parent 79a9a2e commit e7cda1f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

docs/working-notes/todo4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ replace getAllPosts with getAllPostsWithReadingTime,
140140
spellcheck yarn script
141141

142142
use react-icons for icons in react and not slot with astro-icons
143+
144+
gallery cumulative layout shift, min-height, debounce 0 for first page - just set INITIAL_PAGE // ok
143145
```
144146

145147

src/components/react/Gallery.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface Props {
2020

2121
type LoadedStates = Record<string, boolean>;
2222

23+
// INITIAL_PAGE controls first screen
2324
const { PAGE_SIZE, INITIAL_PAGE, OBSERVER_DEBOUNCE, GALLERY_ID } = GALLERY;
2425

2526
const fetchImagesUpToPage = (images: GalleryImage[], nextPage: number): GalleryImage[] => {

src/constants/gallery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const GALLERY = {
55
// Todo: make it responsive
66
/** step. */
77
PAGE_SIZE: 3,
8-
/** page dependency in useEffect is more important */
8+
/** page dependency in useEffect is more important. To load first screen quickly, set to 3 pages */
99
INITIAL_PAGE: 1,
1010
/** fine tuned for scroll */
1111
OBSERVER_DEBOUNCE: 300,

0 commit comments

Comments
 (0)