mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
🐛 wrong absolute position of torrent options menu
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"accordions": {
|
"accordions": {
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"text": "Your downloads"
|
"text": "Your downloads",
|
||||||
|
"torrents": "Your Torrent downloads",
|
||||||
|
"usenet": "Your Usenet downloads"
|
||||||
},
|
},
|
||||||
"others": {
|
"others": {
|
||||||
"text": "Others"
|
"text": "Others"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Grid,
|
Grid,
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
|
Text,
|
||||||
Title,
|
Title,
|
||||||
useMantineColorScheme,
|
useMantineColorScheme,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
@@ -200,17 +201,18 @@ 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 radius="lg">
|
<Paper radius="lg" style={{ position: 'relative' }}>
|
||||||
{torrentEnabled && (
|
{torrentEnabled && (
|
||||||
<>
|
<>
|
||||||
<ModuleMenu module={TorrentsModule} />
|
<Text>{t('accordions.downloads.torrents')}</Text>
|
||||||
|
<ModuleMenu module={TorrentsModule} hovered />
|
||||||
<TorrentsComponent />
|
<TorrentsComponent />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{usenetEnabled && (
|
{usenetEnabled && (
|
||||||
<>
|
<>
|
||||||
{torrentEnabled && <Divider my="sm" />}
|
<Text mt="md">{t('accordions.downloads.usenet')}</Text>
|
||||||
<ModuleMenu module={UsenetModule} />
|
<ModuleMenu module={UsenetModule} hovered />
|
||||||
<UsenetComponent />
|
<UsenetComponent />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
9
src/modules/ModuleTypes.d.ts
vendored
9
src/modules/ModuleTypes.d.ts
vendored
@@ -11,6 +11,15 @@ export interface IModule {
|
|||||||
icon: TablerIcon;
|
icon: TablerIcon;
|
||||||
component: React.ComponentType;
|
component: React.ComponentType;
|
||||||
options?: Option;
|
options?: Option;
|
||||||
|
padding?: PaddingOptions = {
|
||||||
|
right: 15,
|
||||||
|
top: 15,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PaddingOptions {
|
||||||
|
top: number;
|
||||||
|
right: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
|
|||||||
@@ -186,8 +186,13 @@ export function ModuleWrapper(props: any) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ModuleMenu(props: any) {
|
interface ModuleMenuProps {
|
||||||
const { module, styles, hovered } = props;
|
hovered: boolean;
|
||||||
|
module: IModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModuleMenu(props: ModuleMenuProps) {
|
||||||
|
const { module, hovered } = props;
|
||||||
const items: JSX.Element[] = getItems(module);
|
const items: JSX.Element[] = getItems(module);
|
||||||
const { t } = useTranslation('modules/common');
|
const { t } = useTranslation('modules/common');
|
||||||
return (
|
return (
|
||||||
@@ -207,12 +212,13 @@ export function ModuleMenu(props: any) {
|
|||||||
<motion.div
|
<motion.div
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 15,
|
top: module.padding?.top ?? 15,
|
||||||
right: 15,
|
right: module.padding?.right ?? 15,
|
||||||
alignSelf: 'flex-end',
|
alignSelf: 'flex-end',
|
||||||
|
zIndex: 10,
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
opacity: hovered === true ? 1 : 0,
|
opacity: hovered ? 1 : 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ActionIcon>
|
<ActionIcon>
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ export const TorrentsModule: IModule = {
|
|||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
padding: {
|
||||||
|
right: 0,
|
||||||
|
top: -10,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function TorrentsComponent() {
|
export default function TorrentsComponent() {
|
||||||
|
|||||||
Reference in New Issue
Block a user