mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 07:25:48 +01:00
🎨 Improve design for element selector
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Stack, Text, Title } from '@mantine/core';
|
import { Grid, Text } from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
IconArrowsUpDown,
|
IconArrowsUpDown,
|
||||||
IconCalendarTime,
|
IconCalendarTime,
|
||||||
@@ -27,7 +27,7 @@ export const AvailableIntegrationElements = ({
|
|||||||
applications. They usually require a few configurations before use.
|
applications. They usually require a few configurations before use.
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Stack spacing="xs">
|
<Grid>
|
||||||
<GenericAvailableElementType
|
<GenericAvailableElementType
|
||||||
name="Usenet downloads"
|
name="Usenet downloads"
|
||||||
description="Display and manage your Usenet downloads directly from Homarr"
|
description="Display and manage your Usenet downloads directly from Homarr"
|
||||||
@@ -63,7 +63,7 @@ export const AvailableIntegrationElements = ({
|
|||||||
description="Display the current download & upload of your torrent clients"
|
description="Display the current download & upload of your torrent clients"
|
||||||
image={<IconArrowsUpDown />}
|
image={<IconArrowsUpDown />}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, Stack, Text } from '@mantine/core';
|
import { Box, Button, Card, Center, Grid, Stack, Text, UnstyledButton } from '@mantine/core';
|
||||||
import { IconChevronRight } from '@tabler/icons';
|
import { IconChevronRight } from '@tabler/icons';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
@@ -28,34 +28,27 @@ export const GenericAvailableElementType = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Grid.Col span={3}>
|
||||||
className={classes.styledButton}
|
<Card style={{ height: '100%' }}>
|
||||||
leftIcon={<Icon />}
|
<Stack justify="space-between" style={{ height: '100%' }}>
|
||||||
rightIcon={<IconChevronRight opacity={0.5} />}
|
<Stack spacing="xs">
|
||||||
styles={{
|
<Center>
|
||||||
root: {
|
<Icon />
|
||||||
height: 'auto',
|
</Center>
|
||||||
padding: '8px 12px',
|
<Text className={classes.elementText} align="center">
|
||||||
},
|
{name}
|
||||||
inner: {
|
</Text>
|
||||||
justifyContent: 'left',
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
disabled={disabled}
|
|
||||||
fullWidth
|
|
||||||
>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text className={classes.elementText}>{name}</Text>
|
|
||||||
{description && (
|
{description && (
|
||||||
<Text className={classes.elementText} size="xs" color="dimmed">
|
<Text className={classes.elementText} size="xs" align="center" color="dimmed">
|
||||||
{description}
|
{description}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<Button disabled={disabled} variant="light" size="xs" mt="auto" radius="md" fullWidth>
|
||||||
|
Add to Dashboard
|
||||||
</Button>
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Card>
|
||||||
|
</Grid.Col>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const useStyles = createStyles((theme) => ({
|
|||||||
elementButton: {
|
elementButton: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
borderRadius: theme.radius.sm
|
borderRadius: theme.radius.sm,
|
||||||
},
|
},
|
||||||
elementStack: {
|
elementStack: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Stack, Text, Title } from '@mantine/core';
|
import { Grid, Text } from '@mantine/core';
|
||||||
import { IconCursorText } from '@tabler/icons';
|
import { IconCursorText } from '@tabler/icons';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { GenericAvailableElementType } from '../Shared/GenericElementType';
|
import { GenericAvailableElementType } from '../Shared/GenericElementType';
|
||||||
@@ -19,13 +19,13 @@ export const AvailableStaticTypes = ({ onClickBack }: AvailableStaticTypesProps)
|
|||||||
they don't integrate with any services and their content never changes.
|
they don't integrate with any services and their content never changes.
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Stack>
|
<Grid>
|
||||||
<GenericAvailableElementType
|
<GenericAvailableElementType
|
||||||
name="Static Text"
|
name="Static Text"
|
||||||
description="Display a fixed string on your dashboard"
|
description="Display a fixed string on your dashboard"
|
||||||
image={<IconCursorText />}
|
image={<IconCursorText />}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export const AddElementAction = () => {
|
|||||||
openContextModal({
|
openContextModal({
|
||||||
modal: 'selectElement',
|
modal: 'selectElement',
|
||||||
title: 'Add an element to your dashboard',
|
title: 'Add an element to your dashboard',
|
||||||
|
size: 'xl',
|
||||||
innerProps: {},
|
innerProps: {},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user