mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Redo queue handler as hook
This commit is contained in:
parent
3dd9e620a8
commit
c858479d57
12 changed files with 247 additions and 199 deletions
|
|
@ -5,7 +5,13 @@ import type { FixedSizeListProps } from 'react-window';
|
|||
import { FixedSizeList } from 'react-window';
|
||||
import styled from 'styled-components';
|
||||
import { GridCard } from '/@/renderer/components/virtual-grid/grid-card';
|
||||
import type { CardRow, LibraryItem, CardDisplayType, CardRoute } from '/@/renderer/types';
|
||||
import type {
|
||||
CardRow,
|
||||
LibraryItem,
|
||||
CardDisplayType,
|
||||
CardRoute,
|
||||
PlayQueueAddOptions,
|
||||
} from '/@/renderer/types';
|
||||
|
||||
const createItemData = memoize(
|
||||
(
|
||||
|
|
@ -19,10 +25,12 @@ const createItemData = memoize(
|
|||
itemType,
|
||||
itemWidth,
|
||||
route,
|
||||
handlePlayQueueAdd,
|
||||
) => ({
|
||||
cardRows,
|
||||
columnCount,
|
||||
display,
|
||||
handlePlayQueueAdd,
|
||||
itemCount,
|
||||
itemData,
|
||||
itemGap,
|
||||
|
|
@ -47,6 +55,7 @@ export const VirtualGridWrapper = ({
|
|||
columnCount,
|
||||
rowCount,
|
||||
initialScrollOffset,
|
||||
handlePlayQueueAdd,
|
||||
itemData,
|
||||
route,
|
||||
onScroll,
|
||||
|
|
@ -55,6 +64,7 @@ export const VirtualGridWrapper = ({
|
|||
cardRows: CardRow[];
|
||||
columnCount: number;
|
||||
display: CardDisplayType;
|
||||
handlePlayQueueAdd?: (options: PlayQueueAddOptions) => void;
|
||||
itemData: any[];
|
||||
itemGap: number;
|
||||
itemHeight: number;
|
||||
|
|
@ -75,6 +85,7 @@ export const VirtualGridWrapper = ({
|
|||
itemType,
|
||||
itemWidth,
|
||||
route,
|
||||
handlePlayQueueAdd,
|
||||
);
|
||||
|
||||
const memoizedOnScroll = createScrollHandler(onScroll);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue