Removed new Features on Mobile (Temporary)

This commit is contained in:
Larvey
2022-06-12 00:52:12 -04:00
committed by GitHub
parent 8eae5a908c
commit ec92a1d89c

View File

@@ -18,6 +18,7 @@ import { IModule } from '../modules';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../../tools/state';
import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem'; import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem';
import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval'; import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval';
import { useViewportSize } from '@mantine/hooks';
export const DownloadsModule: IModule = { export const DownloadsModule: IModule = {
title: 'Torrent', title: 'Torrent',
@@ -34,6 +35,7 @@ export const DownloadsModule: IModule = {
export default function DownloadComponent() { export default function DownloadComponent() {
const { config } = useConfig(); const { config } = useConfig();
const { height, width } = useViewportSize();
const downloadServices = const downloadServices =
config.services.filter( config.services.filter(
(service) => (service) =>
@@ -85,10 +87,10 @@ export default function DownloadComponent() {
const ths = ( const ths = (
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size</th> {width > 576 ? <th>Size</th> : ``}
<th>Download</th> <th>Down</th>
<th>Upload</th> <th>Up</th>
<th>ETA</th> {width > 576 ? <th>ETA</th> : ``}
<th>Progress</th> <th>Progress</th>
</tr> </tr>
); );
@@ -137,18 +139,22 @@ export default function DownloadComponent() {
</Text> </Text>
</Tooltip> </Tooltip>
</td> </td>
{width > 576 ?
<td> <td>
<Text size="xs">{size > 0 ? (size > 999 ? `${(size / 1024).toFixed(1)} GB` : `${size.toFixed(1)} MB`) : '-' }</Text> <Text size="xs">{size > 0 ? (size > 999 ? `${(size / 1024).toFixed(1)} GB` : `${size.toFixed(1)} MB`) : '-' }</Text>
</td> </td> :
``}
<td> <td>
<Text size="xs">{downloadSpeed > 0 ? `${downloadSpeed.toFixed(1)} Mb/s` : '-'}</Text> <Text size="xs">{downloadSpeed > 0 ? `${downloadSpeed.toFixed(1)} Mb/s` : '-'}</Text>
</td> </td>
<td> <td>
<Text size="xs">{uploadSpeed > 0 ? `${uploadSpeed.toFixed(1)} Mb/s` : '-'}</Text> <Text size="xs">{uploadSpeed > 0 ? `${uploadSpeed.toFixed(1)} Mb/s` : '-'}</Text>
</td> </td>
{width > 576 ?
<td> <td>
<Text size="xs">{torrent.eta <= 0 ? '∞' : calculateETA(torrent.eta)}</Text> <Text size="xs">{torrent.eta <= 0 ? '∞' : calculateETA(torrent.eta)}</Text>
</td> </td> :
``}
<td> <td>
<Text>{(torrent.progress * 100).toFixed(1)}%</Text> <Text>{(torrent.progress * 100).toFixed(1)}%</Text>
<Progress <Progress