This commit is contained in:
Jannes Vandepitte
2022-09-01 11:01:47 +02:00
parent 3d98b38955
commit 91a8510859

View File

@@ -1,5 +1,13 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Accordion, Grid, Paper, Stack, useMantineColorScheme } from '@mantine/core'; import {
Accordion,
Divider,
Grid,
Paper,
Stack,
Title,
useMantineColorScheme,
} from '@mantine/core';
import { import {
closestCenter, closestCenter,
DndContext, DndContext,
@@ -128,8 +136,8 @@ const AppShelf = (props: any) => {
(e) => e.category === undefined || e.category === null (e) => e.category === undefined || e.category === null
); );
const usenetEnabled = config.modules?.[TorrentsModule.id]?.enabled ?? false; const torrentEnabled = config.modules?.[TorrentsModule.id]?.enabled ?? false;
const torrentEnabled = config.modules?.[UsenetModule.id]?.enabled ?? false; const usenetEnabled = config.modules?.[UsenetModule.id]?.enabled ?? false;
const downloadEnabled = usenetEnabled || torrentEnabled; const downloadEnabled = usenetEnabled || torrentEnabled;
// Create an item with 0: true, 1: true, 2: true... For each category // Create an item with 0: true, 1: true, 2: true... For each category
@@ -164,7 +172,6 @@ const AppShelf = (props: any) => {
<Accordion.Control>{t('accordions.downloads.text')}</Accordion.Control> <Accordion.Control>{t('accordions.downloads.text')}</Accordion.Control>
<Accordion.Panel> <Accordion.Panel>
<Paper <Paper
p="lg"
radius="lg" radius="lg"
style={{ style={{
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \ background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
@@ -177,12 +184,17 @@ const AppShelf = (props: any) => {
> >
{torrentEnabled && ( {torrentEnabled && (
<> <>
<Title size="h2">Torrents</Title>
<ModuleMenu module={TorrentsModule} /> <ModuleMenu module={TorrentsModule} />
<TorrentsComponent /> <TorrentsComponent />
</> </>
)} )}
{usenetEnabled && ( {usenetEnabled && (
<> <>
{torrentEnabled && <Divider my="sm" />}
<Title size="h2" mt={0}>
Usenet
</Title>
<ModuleMenu module={UsenetModule} /> <ModuleMenu module={UsenetModule} />
<UsenetComponent /> <UsenetComponent />
</> </>