mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-15 16:04:19 +02:00
Add scroll events to grid
This commit is contained in:
@@ -22,8 +22,10 @@ export const VirtualGridWrapper = ({
|
|||||||
itemCount,
|
itemCount,
|
||||||
columnCount,
|
columnCount,
|
||||||
rowCount,
|
rowCount,
|
||||||
|
initialScrollOffset,
|
||||||
itemData,
|
itemData,
|
||||||
route,
|
route,
|
||||||
|
onScroll,
|
||||||
...rest
|
...rest
|
||||||
}: Omit<FixedSizeListProps, 'ref' | 'itemSize' | 'children'> & {
|
}: Omit<FixedSizeListProps, 'ref' | 'itemSize' | 'children'> & {
|
||||||
cardRows: CardRow[];
|
cardRows: CardRow[];
|
||||||
@@ -75,10 +77,12 @@ export const VirtualGridWrapper = ({
|
|||||||
ref={refInstance}
|
ref={refInstance}
|
||||||
{...rest}
|
{...rest}
|
||||||
useIsScrolling
|
useIsScrolling
|
||||||
|
initialScrollOffset={initialScrollOffset}
|
||||||
itemCount={rowCount}
|
itemCount={rowCount}
|
||||||
itemData={{ ...memo, handlePlayQueueAdd }}
|
itemData={{ ...memo, handlePlayQueueAdd }}
|
||||||
itemSize={itemHeight}
|
itemSize={itemHeight}
|
||||||
overscanCount={5}
|
overscanCount={5}
|
||||||
|
onScroll={onScroll}
|
||||||
>
|
>
|
||||||
{GridCard}
|
{GridCard}
|
||||||
</FixedSizeList>
|
</FixedSizeList>
|
||||||
|
|||||||
@@ -34,9 +34,11 @@ export const VirtualInfiniteGrid = ({
|
|||||||
itemType,
|
itemType,
|
||||||
cardRows,
|
cardRows,
|
||||||
route,
|
route,
|
||||||
|
onScroll,
|
||||||
display,
|
display,
|
||||||
minimumBatchSize,
|
minimumBatchSize,
|
||||||
fetchFn,
|
fetchFn,
|
||||||
|
initialScrollOffset,
|
||||||
height,
|
height,
|
||||||
width,
|
width,
|
||||||
refresh,
|
refresh,
|
||||||
@@ -118,6 +120,7 @@ export const VirtualInfiniteGrid = ({
|
|||||||
columnCount={columnCount}
|
columnCount={columnCount}
|
||||||
display={display || CardDisplayType.CARD}
|
display={display || CardDisplayType.CARD}
|
||||||
height={height}
|
height={height}
|
||||||
|
initialScrollOffset={initialScrollOffset}
|
||||||
itemCount={itemCount || 0}
|
itemCount={itemCount || 0}
|
||||||
itemData={itemData}
|
itemData={itemData}
|
||||||
itemGap={itemGap}
|
itemGap={itemGap}
|
||||||
@@ -132,6 +135,7 @@ export const VirtualInfiniteGrid = ({
|
|||||||
rowCount={rowCount}
|
rowCount={rowCount}
|
||||||
width={width}
|
width={width}
|
||||||
onItemsRendered={onItemsRendered}
|
onItemsRendered={onItemsRendered}
|
||||||
|
onScroll={onScroll}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</InfiniteLoader>
|
</InfiniteLoader>
|
||||||
|
|||||||
Reference in New Issue
Block a user