Compare commits

..
Author SHA1 Message Date
Rui be57b2facf Change iOS app scheme to dydx-t-v4 2024-01-25 05:37:02 -08:00
+4 -5
View File
@@ -125,7 +125,7 @@ export const Table = <TableRowData extends object, TableRowKey extends Key>({
selectionMode = 'single',
selectionBehavior = 'toggle',
slotEmpty,
initialNumRowsToShow,
initialNumRowsToShow = data.length,
// shouldRowRender,
// collection,
@@ -142,7 +142,6 @@ export const Table = <TableRowData extends object, TableRowKey extends Key>({
}: ElementProps<TableRowData, TableRowKey> & StyleProps) => {
const [selectedKeys, setSelectedKeys] = useState(new Set<TableRowKey>());
const [numRowsToShow, setNumRowsToShow] = useState(initialNumRowsToShow);
const enableViewMore = numRowsToShow !== undefined;
const currentBreakpoints = useBreakpoints();
const shownColumns = columns.filter(
@@ -218,7 +217,7 @@ export const Table = <TableRowData extends object, TableRowKey extends Key>({
}
numColumns={shownColumns.length}
onViewMoreClick={
enableViewMore && numRowsToShow < data.length
numRowsToShow !== undefined && numRowsToShow < data.length
? () => setNumRowsToShow(data.length)
: undefined
}
@@ -246,7 +245,7 @@ export const Table = <TableRowData extends object, TableRowKey extends Key>({
)}
</TableHeader>
<TableBody items={enableViewMore ? list.items.slice(0, numRowsToShow) : list.items}>
<TableBody items={list.items.slice(0, numRowsToShow)}>
{(item) => (
<Row key={getRowKey(item)}>
{(columnKey) => (
@@ -983,4 +982,4 @@ Styled.ViewMoreButton = styled(Button)`
width: 0.675rem;
margin-left: 0.5ch;
}
`;
`;