mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-11 23:04:40 +02:00
Add dynamic grid sizing
This commit is contained in:
@@ -72,7 +72,7 @@ export const VirtualInfiniteGrid = forwardRef(
|
||||
const [itemData, setItemData] = useState<any[]>(fetchInitialData?.() || []);
|
||||
|
||||
const { itemHeight, rowCount, columnCount } = useMemo(() => {
|
||||
const itemsPerRow = itemSize;
|
||||
const itemsPerRow = width ? Math.floor(width / itemSize) : 5;
|
||||
const widthPerItem = Number(width) / itemsPerRow;
|
||||
const itemHeight = widthPerItem + cardRows.length * 26;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user