diff --git a/app/root.tsx b/app/root.tsx index 301775e..e163251 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -33,7 +33,8 @@ import { Box, Group, UnstyledButton, - ThemeIcon + ThemeIcon, + NavLink } from '@mantine/core'; import { useColorScheme, useLocalStorage } from '@mantine/hooks'; import { StylesPlaceholder } from '@mantine/remix'; @@ -102,7 +103,6 @@ function Document({ }) { const preferredColorScheme = useColorScheme(); const toggleColorScheme = (value?: ColorScheme) => { - console.log(value); setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); }; @@ -248,230 +248,77 @@ function Layout({ children }: React.PropsWithChildren<{}>) { {user && ( - ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Home" + icon={ - - - Home - - - - + ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Time entries" + icon={ - - - Time entries - - - - + ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Projects" + icon={ - - - Projects - - - - + ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Report" + icon={ - - - Report - - - - + ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Import/Export" + icon={ - - - Import/Export - - - - + ({ - display: 'block', - width: '100%', - padding: theme.spacing.xs, - borderRadius: theme.radius.sm, - color: - theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.black, - - '&:hover': { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[6] - : theme.colors.gray[0] - } - })} - > - + label="Statistics" + icon={ - - - Statistics - - - + } + variant="light" + active={location.pathname.includes('/statistics')} + /> )} {user && (