mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
add enum for table item size
This commit is contained in:
@@ -75,6 +75,12 @@ const hasRequiredStateItemProperties = (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum TableItemSize {
|
||||||
|
COMPACT = 40,
|
||||||
|
DEFAULT = 64,
|
||||||
|
LARGE = 88,
|
||||||
|
}
|
||||||
|
|
||||||
interface VirtualizedTableGridProps {
|
interface VirtualizedTableGridProps {
|
||||||
calculatedColumnWidths: number[];
|
calculatedColumnWidths: number[];
|
||||||
CellComponent: JSXElementConstructor<CellComponentProps<TableItemProps>>;
|
CellComponent: JSXElementConstructor<CellComponentProps<TableItemProps>>;
|
||||||
@@ -684,7 +690,12 @@ export const ItemTableList = ({
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const DEFAULT_ROW_HEIGHT = size === 'compact' ? 40 : size === 'large' ? 88 : 64;
|
const DEFAULT_ROW_HEIGHT =
|
||||||
|
size === 'compact'
|
||||||
|
? TableItemSize.COMPACT
|
||||||
|
: size === 'large'
|
||||||
|
? TableItemSize.LARGE
|
||||||
|
: TableItemSize.DEFAULT;
|
||||||
|
|
||||||
const calculateScrollTopForIndex = useCallback(
|
const calculateScrollTopForIndex = useCallback(
|
||||||
(index: number) => {
|
(index: number) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user