mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 15:05:48 +01:00
Fix right menu position and a typo
This commit is contained in:
@@ -4,11 +4,12 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
createStyles,
|
createStyles,
|
||||||
Center,
|
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Card,
|
Card,
|
||||||
useMantineTheme,
|
useMantineTheme,
|
||||||
Image,
|
Image,
|
||||||
|
Group,
|
||||||
|
Space,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import AppShelfMenu from './AppShelfMenu';
|
import AppShelfMenu from './AppShelfMenu';
|
||||||
import AddItemShelfItem from './AddAppShelfItem';
|
import AddItemShelfItem from './AddAppShelfItem';
|
||||||
@@ -60,6 +61,7 @@ export function AppShelfItem(props: any) {
|
|||||||
const [hovering, setHovering] = useState(false);
|
const [hovering, setHovering] = useState(false);
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
|
key={service.name}
|
||||||
onHoverStart={(e) => {
|
onHoverStart={(e) => {
|
||||||
setHovering(true);
|
setHovering(true);
|
||||||
}}
|
}}
|
||||||
@@ -74,19 +76,35 @@ export function AppShelfItem(props: any) {
|
|||||||
}}
|
}}
|
||||||
radius="md"
|
radius="md"
|
||||||
>
|
>
|
||||||
<motion.div
|
|
||||||
animate={{
|
|
||||||
opacity: hovering ? 1 : 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<AppShelfMenu name={service.name} removeitem={removeService} />
|
|
||||||
</motion.div>
|
|
||||||
<Card.Section>
|
<Card.Section>
|
||||||
<Center>
|
<Group position="apart" mx="lg">
|
||||||
<Text mt="sm" weight={500}>
|
<Space />
|
||||||
|
<Text
|
||||||
|
// TODO: #1 Remove this hack to get the text to be centered.
|
||||||
|
ml={15}
|
||||||
|
style={{
|
||||||
|
alignSelf: 'center',
|
||||||
|
alignContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
justifyItems: 'center',
|
||||||
|
}}
|
||||||
|
mt="sm"
|
||||||
|
weight={500}
|
||||||
|
>
|
||||||
{service.name}
|
{service.name}
|
||||||
</Text>
|
</Text>
|
||||||
</Center>
|
<motion.div
|
||||||
|
style={{
|
||||||
|
alignSelf: 'flex-end',
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
opacity: hovering ? 1 : 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AppShelfMenu name={service.name} removeitem={removeService} />
|
||||||
|
</motion.div>
|
||||||
|
</Group>
|
||||||
</Card.Section>
|
</Card.Section>
|
||||||
<Card.Section>
|
<Card.Section>
|
||||||
<AspectRatio ratio={5 / 3} m="xl">
|
<AspectRatio ratio={5 / 3} m="xl">
|
||||||
|
|||||||
@@ -5,17 +5,12 @@ import { Check, Edit, Trash } from 'tabler-icons-react';
|
|||||||
export default function AppShelfMenu(props: any) {
|
export default function AppShelfMenu(props: any) {
|
||||||
const { name, removeitem: removeItem } = props;
|
const { name, removeitem: removeItem } = props;
|
||||||
return (
|
return (
|
||||||
<Menu
|
<Menu position="right">
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 10,
|
|
||||||
right: 10,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Menu.Label>Settings</Menu.Label>
|
<Menu.Label>Settings</Menu.Label>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
color="primary"
|
color="primary"
|
||||||
icon={<Edit size={14} />}
|
icon={<Edit size={14} />}
|
||||||
|
// TODO: #2 Add the ability to edit the service.
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
showNotification({
|
showNotification({
|
||||||
color: 'red',
|
color: 'red',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function SettingsMenu(props: any) {
|
|||||||
color: '#a0aec0',
|
color: '#a0aec0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
tip: You can upload your config file by dragging and dropping it into the page
|
tip: You can upload your config file by dragging and dropping it onto the page
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user