refactor: improve torrent table design (#1786)
This commit is contained in:
@@ -130,6 +130,7 @@ function TorrentTile({ widget }: TorrentTileProps) {
|
|||||||
id: "dateAdded",
|
id: "dateAdded",
|
||||||
accessorFn: (row) => new Date(row.dateAdded),
|
accessorFn: (row) => new Date(row.dateAdded),
|
||||||
header: "dateAdded",
|
header: "dateAdded",
|
||||||
|
maxSize: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'name',
|
accessorKey: 'name',
|
||||||
@@ -146,9 +147,7 @@ function TorrentTile({ widget }: TorrentTileProps) {
|
|||||||
>
|
>
|
||||||
<Popover.Target>
|
<Popover.Target>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
maw={"30vw"}
|
||||||
maxWidth: '30vw',
|
|
||||||
}}
|
|
||||||
size="xs"
|
size="xs"
|
||||||
lineClamp={1}
|
lineClamp={1}
|
||||||
>
|
>
|
||||||
@@ -160,34 +159,41 @@ function TorrentTile({ widget }: TorrentTileProps) {
|
|||||||
</Popover.Dropdown>
|
</Popover.Dropdown>
|
||||||
</Popover>
|
</Popover>
|
||||||
),
|
),
|
||||||
|
maxSize: 1,
|
||||||
|
size: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'totalSize',
|
accessorKey: 'totalSelected',
|
||||||
header: t('card.table.header.size'),
|
header: t('card.table.header.size'),
|
||||||
Cell: ({ cell }) => formatSize(Number(cell.getValue())),
|
Cell: ({ cell }) => formatSize(Number(cell.getValue())),
|
||||||
sortDescFirst: true,
|
sortDescFirst: true,
|
||||||
|
maxSize: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'uploadSpeed',
|
accessorKey: 'uploadSpeed',
|
||||||
header: t('card.table.header.upload'),
|
header: t('card.table.header.upload'),
|
||||||
Cell: ({ cell }) => formatSpeed(Number(cell.getValue())),
|
Cell: ({ cell }) => formatSpeed(Number(cell.getValue())),
|
||||||
sortDescFirst: true,
|
sortDescFirst: true,
|
||||||
|
maxSize: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'downloadSpeed',
|
accessorKey: 'downloadSpeed',
|
||||||
header: t('card.table.header.download'),
|
header: t('card.table.header.download'),
|
||||||
Cell: ({ cell }) => formatSpeed(Number(cell.getValue())),
|
Cell: ({ cell }) => formatSpeed(Number(cell.getValue())),
|
||||||
sortDescFirst: true,
|
sortDescFirst: true,
|
||||||
|
maxSize: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'eta',
|
accessorKey: 'eta',
|
||||||
header: t('card.table.header.estimatedTimeOfArrival'),
|
header: t('card.table.header.estimatedTimeOfArrival'),
|
||||||
Cell: ({ cell }) => formatETA(Number(cell.getValue())),
|
Cell: ({ cell }) => formatETA(Number(cell.getValue())),
|
||||||
sortDescFirst: true,
|
sortDescFirst: true,
|
||||||
|
maxSize: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'progress',
|
accessorKey: 'progress',
|
||||||
header: t('card.table.header.progress'),
|
header: t('card.table.header.progress'),
|
||||||
|
maxSize: 1,
|
||||||
Cell: ({ cell, row }) => (
|
Cell: ({ cell, row }) => (
|
||||||
<Flex>
|
<Flex>
|
||||||
<Text className={useStyles().classes.noTextBreak}>{(Number(cell.getValue()) * 100).toFixed(1)}%</Text>
|
<Text className={useStyles().classes.noTextBreak}>{(Number(cell.getValue()) * 100).toFixed(1)}%</Text>
|
||||||
@@ -291,7 +297,7 @@ function TorrentTile({ widget }: TorrentTileProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex direction="column" sx={{ height: '100%' }} ref={ref}>
|
<Flex direction="column" sx={{ height: '100%' }} ref={ref}>
|
||||||
<ScrollArea>
|
<ScrollArea style={{ flexGrow: 1 }}>
|
||||||
<MRT_Table table={torrentsTable} />
|
<MRT_Table table={torrentsTable} />
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
<Group spacing="sm">
|
<Group spacing="sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user