diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 79d714183..c8a2a33fa 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -18,7 +18,7 @@ env: # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io # github.repository as / - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: ${{ github.repository }}-test jobs: # Push image to GitHub Packages. diff --git a/src/components/AppShelf/AddAppShelfItem.tsx b/src/components/AppShelf/AddAppShelfItem.tsx index 5f42d2af2..9a413ba5d 100644 --- a/src/components/AppShelf/AddAppShelfItem.tsx +++ b/src/components/AppShelf/AddAppShelfItem.tsx @@ -10,6 +10,8 @@ import { Text, Card, LoadingOverlay, + ActionIcon, + Tooltip, } from '@mantine/core'; import { useForm } from '@mantine/form'; import { motion } from 'framer-motion'; @@ -19,13 +21,42 @@ import { useConfig } from '../../tools/state'; import { ServiceTypeList } from '../../tools/types'; import { AppShelfItemWrapper } from './AppShelfItemWrapper'; +export function AddItemShelfButton(props: any) { + const [opened, setOpened] = useState(false); + return ( + <> + setOpened(false)} + title="Add a service" + > + + + setOpened(true)} + > + + + + + + ); +} + export default function AddItemShelfItem(props: any) { const [opened, setOpened] = useState(false); return ( <> setOpened(false)} title="Add a service" diff --git a/src/components/AppShelf/AppShelf.story.tsx b/src/components/AppShelf/AppShelf.story.tsx index 610f1370c..928510aac 100644 --- a/src/components/AppShelf/AppShelf.story.tsx +++ b/src/components/AppShelf/AppShelf.story.tsx @@ -1,3 +1,4 @@ +import { SimpleGrid } from '@mantine/core'; import AppShelf, { AppShelfItem } from './AppShelf'; export default { @@ -16,3 +17,10 @@ export default { export const Default = (args: any) => ; export const One = (args: any) => ; +export const Ten = (args: any) => ( + + {Array.from(Array(10)).map((_, i) => ( + + ))} + +); diff --git a/src/components/AppShelf/AppShelf.tsx b/src/components/AppShelf/AppShelf.tsx index af5f85340..d76413811 100644 --- a/src/components/AppShelf/AppShelf.tsx +++ b/src/components/AppShelf/AppShelf.tsx @@ -1,21 +1,29 @@ import React, { useState } from 'react'; import { motion } from 'framer-motion'; -import { Text, AspectRatio, SimpleGrid, Card, Image, Group, Space } from '@mantine/core'; +import { Text, AspectRatio, SimpleGrid, Card, Image, useMantineTheme } from '@mantine/core'; import { useConfig } from '../../tools/state'; import { serviceItem } from '../../tools/types'; -import AddItemShelfItem from './AddAppShelfItem'; -import { AppShelfItemWrapper } from './AppShelfItemWrapper'; import AppShelfMenu from './AppShelfMenu'; const AppShelf = () => { const { config } = useConfig(); return ( - + {config.services.map((service) => ( ))} - ); }; @@ -23,6 +31,7 @@ const AppShelf = () => { export function AppShelfItem(props: any) { const { service }: { service: serviceItem } = props; const [hovering, setHovering] = useState(false); + const theme = useMantineTheme(); return ( - + - - - - {service.name} - - - - - + + {service.name} + + + + - + { window.open(service.url); }} - style={{ - maxWidth: '50%', - marginBottom: 10, - }} src={service.icon} /> - + ); } diff --git a/src/components/AppShelf/AppShelfItemWrapper.tsx b/src/components/AppShelf/AppShelfItemWrapper.tsx index a305661e6..ffe409062 100644 --- a/src/components/AppShelf/AppShelfItemWrapper.tsx +++ b/src/components/AppShelf/AppShelfItemWrapper.tsx @@ -8,10 +8,6 @@ export function AppShelfItemWrapper(props: any) { style={{ boxShadow: hovering ? '0px 0px 3px rgba(0, 0, 0, 0.5)' : '0px 0px 1px rgba(0, 0, 0, 0.5)', backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[1], - - //TODO: #3 Fix this temporary fix and make the width and height dynamic / responsive - width: 200, - height: 180, }} radius="md" > diff --git a/src/components/Settings/SettingsMenu.tsx b/src/components/Settings/SettingsMenu.tsx index bce50fd0b..061ef2165 100644 --- a/src/components/Settings/SettingsMenu.tsx +++ b/src/components/Settings/SettingsMenu.tsx @@ -122,7 +122,7 @@ export function SettingsMenuButton(props: any) { Made with ❤️ by @ - + ajnart diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index b8eb2a9ab..44185e28e 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -1,18 +1,11 @@ -import React, { useState } from 'react'; -import { - createStyles, - Header as Head, - Container, - Group, - Burger, - Drawer, - Center, -} from '@mantine/core'; +import React from 'react'; +import { createStyles, Header as Head, Group, Drawer, Center } from '@mantine/core'; import { useBooleanToggle } from '@mantine/hooks'; import { NextLink } from '@mantine/next'; import { Logo } from './Logo'; -import { SettingsMenuButton } from '../Settings/SettingsMenu'; import CalendarComponent from '../modules/calendar/CalendarModule'; +import { SettingsMenuButton } from '../Settings/SettingsMenu'; +import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem'; const HEADER_HEIGHT = 60; @@ -40,8 +33,6 @@ const useStyles = createStyles((theme) => ({ header: { display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', height: '100%', }, @@ -94,62 +85,33 @@ interface HeaderResponsiveProps { export function Header({ links }: HeaderResponsiveProps) { const [opened, toggleOpened] = useBooleanToggle(false); - const [active, setActive] = useState('/'); const { classes, cx } = useStyles(); - const items = ( - <> - {links.map((link) => ( - { - setActive(link.link); - toggleOpened(false); - }} - > - {link.label} - - ))} - - ); return ( - - - - - - - - - {items} - + + + + + - - toggleOpened()} - className={classes.burger} - size="sm" - /> + + - toggleOpened()} - position="right" - > - {opened ?? ( -
- -
- )} -
-
+ toggleOpened()} + position="right" + > + {opened ?? ( +
+ +
+ )} +
); } diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index d486766af..ab646803d 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -7,7 +7,7 @@ import Navbar from './Navbar'; const useStyles = createStyles((theme) => ({ main: { [theme.fn.largerThan('md')]: { - maxWidth: 1200, + maxWidth: 1500, }, }, })); diff --git a/src/components/layout/Logo.tsx b/src/components/layout/Logo.tsx index 824688a1b..f85bca9e1 100644 --- a/src/components/layout/Logo.tsx +++ b/src/components/layout/Logo.tsx @@ -1,15 +1,29 @@ -import { Text } from '@mantine/core'; +import { Group, Text } from '@mantine/core'; import * as React from 'react'; +import { CURRENT_VERSION } from '../../../data/constants'; export function Logo({ style }: any) { return ( - - Homarr - + + + Homarr + + + {CURRENT_VERSION} + + ); } diff --git a/src/components/layout/Navbar.tsx b/src/components/layout/Navbar.tsx index 2f9b26f0b..a8ff679a0 100644 --- a/src/components/layout/Navbar.tsx +++ b/src/components/layout/Navbar.tsx @@ -6,7 +6,7 @@ export default function Navbar() { return (