mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Improve grid size, language
This commit is contained in:
parent
ce9c03b0e1
commit
2f105956b9
6 changed files with 43 additions and 21 deletions
|
|
@ -72,7 +72,7 @@ export const VirtualInfiniteGrid = forwardRef(
|
|||
const [itemData, setItemData] = useState<any[]>(fetchInitialData?.() || []);
|
||||
|
||||
const { itemHeight, rowCount, columnCount } = useMemo(() => {
|
||||
const itemsPerRow = width ? Math.floor(width / itemSize) : 5;
|
||||
const itemsPerRow = width ? Math.floor(width / (itemSize + itemGap * 2)) : 5;
|
||||
const widthPerItem = Number(width) / itemsPerRow;
|
||||
const itemHeight = widthPerItem + cardRows.length * 26;
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ export const VirtualInfiniteGrid = forwardRef(
|
|||
itemHeight,
|
||||
rowCount: Math.ceil(itemCount / itemsPerRow),
|
||||
};
|
||||
}, [cardRows.length, itemCount, itemSize, width]);
|
||||
}, [cardRows.length, itemCount, itemGap, itemSize, width]);
|
||||
|
||||
const isItemLoaded = useCallback(
|
||||
(index: number) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue