mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
✨ Add more transparency areas and fix bugs
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Accordion, createStyles, Grid, Group } from '@mantine/core';
|
import { Accordion, createStyles, Grid, Group, Paper, useMantineColorScheme } from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
closestCenter,
|
closestCenter,
|
||||||
DndContext,
|
DndContext,
|
||||||
@@ -42,6 +42,7 @@ const AppShelf = (props: any) => {
|
|||||||
});
|
});
|
||||||
const [activeId, setActiveId] = useState(null);
|
const [activeId, setActiveId] = useState(null);
|
||||||
const { config, setConfig } = useConfig();
|
const { config, setConfig } = useConfig();
|
||||||
|
const { colorScheme } = useMantineColorScheme();
|
||||||
|
|
||||||
const sensors = useSensors(
|
const sensors = useSensors(
|
||||||
useSensor(TouchSensor, {
|
useSensor(TouchSensor, {
|
||||||
@@ -164,7 +165,16 @@ const AppShelf = (props: any) => {
|
|||||||
) : null}
|
) : null}
|
||||||
<Accordion.Item key="Downloads" label="Your downloads">
|
<Accordion.Item key="Downloads" label="Your downloads">
|
||||||
<ModuleMenu module={DownloadsModule} />
|
<ModuleMenu module={DownloadsModule} />
|
||||||
|
<Paper
|
||||||
|
style={{
|
||||||
|
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
borderColor: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<DownloadComponent />
|
<DownloadComponent />
|
||||||
|
</Paper>
|
||||||
</Accordion.Item>
|
</Accordion.Item>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export default function Aside(props: any) {
|
|||||||
base: 'auto',
|
base: 'auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<>
|
||||||
{matches && (
|
{matches && (
|
||||||
<Group my="sm" grow direction="column" style={{ width: 300 }}>
|
<Group my="sm" grow direction="column" style={{ width: 300 }}>
|
||||||
<ModuleWrapper module={CalendarModule} />
|
<ModuleWrapper module={CalendarModule} />
|
||||||
@@ -42,6 +43,7 @@ export default function Aside(props: any) {
|
|||||||
<ModuleWrapper module={DateModule} />
|
<ModuleWrapper module={DateModule} />
|
||||||
</Group>
|
</Group>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
</MantineAside>
|
</MantineAside>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function DownloadComponent() {
|
|||||||
setTorrents(response.data);
|
setTorrents(response.data);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 5000);
|
||||||
}, [config.services]);
|
}, [config.services]);
|
||||||
|
|
||||||
if (downloadServices.length === 0) {
|
if (downloadServices.length === 0) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, Card, Group, Menu, Switch, TextInput } from '@mantine/core';
|
import { Button, Card, Group, Menu, Switch, TextInput, useMantineColorScheme } from '@mantine/core';
|
||||||
import { useConfig } from '../../tools/state';
|
import { useConfig } from '../../tools/state';
|
||||||
import { IModule } from './modules';
|
import { IModule } from './modules';
|
||||||
|
|
||||||
@@ -91,6 +91,7 @@ function getItems(module: IModule) {
|
|||||||
|
|
||||||
export function ModuleWrapper(props: any) {
|
export function ModuleWrapper(props: any) {
|
||||||
const { module }: { module: IModule } = props;
|
const { module }: { module: IModule } = props;
|
||||||
|
const { colorScheme } = useMantineColorScheme();
|
||||||
const { config, setConfig } = useConfig();
|
const { config, setConfig } = useConfig();
|
||||||
const enabledModules = config.modules ?? {};
|
const enabledModules = config.modules ?? {};
|
||||||
// Remove 'Module' from enabled modules titles
|
// Remove 'Module' from enabled modules titles
|
||||||
@@ -99,8 +100,21 @@ export function ModuleWrapper(props: any) {
|
|||||||
if (!isShown) {
|
if (!isShown) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card {...props} hidden={!isShown} withBorder radius="lg" shadow="sm">
|
<Card
|
||||||
|
{...props}
|
||||||
|
hidden={!isShown}
|
||||||
|
withBorder
|
||||||
|
radius="lg"
|
||||||
|
shadow="sm"
|
||||||
|
style={{
|
||||||
|
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
borderColor: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ModuleMenu
|
<ModuleMenu
|
||||||
module={module}
|
module={module}
|
||||||
styles={{
|
styles={{
|
||||||
|
|||||||
Reference in New Issue
Block a user