From 12481b2eb6ec4660521e065bbf0e3981cb29f535 Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Fri, 24 Jan 2025 13:42:48 -0600 Subject: [PATCH] New menu --- .../homepage/components/SettingsButton.tsx | 240 ++++++++++++------ src/styles/ActionIcon.module.css | 21 ++ src/styles/Button.module.css | 23 ++ src/styles/Menu.module.css | 4 + src/styles/Select.module.css | 34 ++- 5 files changed, 243 insertions(+), 79 deletions(-) diff --git a/src/pages/homepage/components/SettingsButton.tsx b/src/pages/homepage/components/SettingsButton.tsx index 870e3a9..56d3234 100644 --- a/src/pages/homepage/components/SettingsButton.tsx +++ b/src/pages/homepage/components/SettingsButton.tsx @@ -1,9 +1,19 @@ -import { Button, Menu, MultiSelect, NavLink, Switch } from '@mantine/core'; +import { + ActionIcon, + Button, + Group, + Menu, + MultiSelect, + Stack, + Text, + Tooltip, +} from '@mantine/core'; import { runWakeCommand, useCommonHooks, useQueryAPI } from 'hooks'; import { useEffect, useState } from 'react'; -import { FiMenu, FiMonitor, FiShuffle } from 'react-icons/fi'; +import { FaDice } from 'react-icons/fa'; +import { FiMenu, FiMonitor, FiSettings, FiShuffle } from 'react-icons/fi'; import { useNavigate } from 'react-router-dom'; -import { buttonClasses, menuClasses, navLinkClasses, selectClasses } from 'styles'; +import { actionIconClasses, buttonClasses, menuClasses, selectClasses } from 'styles'; function SettingsButton() { const { data, isFetched } = useQueryAPI({ endpoint: 'api/appCategories' }); @@ -31,82 +41,170 @@ function SettingsButton() { setCategories(list); } }, [data, isFetched]); - return ( - + - - navigate(`/${import.meta.env.VITE_BASE_URL}/settings`)} - /> - - } - onClick={() => runWakeCommand()} - className={navLinkClasses.defaultNavLink} - classNames={navLinkClasses} + + + + navigate(`/${import.meta.env.VITE_BASE_URL}/settings`)} + style={{ + cursor: 'pointer', + position: 'absolute', + top: '.5rem', + right: '.5rem', + }} + /> + + + + Wake on LAN + + + + Themes + + + { + setCurrentTheme(currentTheme === 'random' ? theme.name : 'random'); + }} + > + + + + + { + handleThemeChange(allThemes, true); + }} + > + + + + + + Currently:{' '} + + {theme.name} + + + - { - setCurrentTheme(e.target.checked ? 'random' : theme.name); - }} - color={theme.primaryColor} - /> - } - onClick={() => {}} - className={navLinkClasses.defaultNavLink} - classNames={navLinkClasses} - /> - } - onClick={() => { - handleThemeChange(allThemes, true); + - - { - setAppFilter(data); - }} - classNames={selectClasses} - comboboxProps={{ withinPortal: false }} - /> - { - setBookmarkFilter(data); - }} - classNames={selectClasses} - comboboxProps={{ withinPortal: false }} - /> + > + Filters + + 0 + ? appFilter.length === 1 + ? appFilter[0] + : `${appFilter.length} apps selected` + : 'No apps selected' + } + defaultValue={appFilter} + onChange={(data: any) => { + setAppFilter(data); + }} + classNames={selectClasses} + comboboxProps={{ withinPortal: false }} + /> + 0 + ? bookmarkFilter.length === 1 + ? bookmarkFilter[0] + : `${bookmarkFilter.length} bookmarks selected` + : 'No bookmarks selected' + } + defaultValue={bookmarkFilter} + onChange={(data: any) => { + setBookmarkFilter(data); + }} + classNames={selectClasses} + comboboxProps={{ withinPortal: false }} + /> + + + ); diff --git a/src/styles/ActionIcon.module.css b/src/styles/ActionIcon.module.css index 84dacf9..ed4177d 100644 --- a/src/styles/ActionIcon.module.css +++ b/src/styles/ActionIcon.module.css @@ -34,4 +34,25 @@ color: var(--color-text-acc) !important; } } +} + +.menuActions { + &.root { + transition: all .1s ease; + width: 40px; + height: 30px; + border-radius: 10px; + border: none; + .icon { + font-size: 24px; + } + .loader { + display: none; + } + :hover { + background-color: var(--color-text-pri) !important; + color: var(--color-text-acc) !important; + transition: all .1s ease; + } + } } \ No newline at end of file diff --git a/src/styles/Button.module.css b/src/styles/Button.module.css index ecbe664..b7c74b5 100644 --- a/src/styles/Button.module.css +++ b/src/styles/Button.module.css @@ -34,6 +34,29 @@ } } +.wakeButton{ + &.root { + font-size: 1em; + font-weight:500; + margin: 10px; + width:108px; + height:96px; + line-height: 3rem; + text-align: center; + text-transform: uppercase; + border-radius: 1em; + color: var(--color-text-acc); + background-color: var(--color-background); + border: solid 2px var(--color-text-pri); + transition: all .2s ease; + &:hover { + color: var(--color-background); + background-color: var(--color-text-pri); + border: solid 2px var(--color-text-acc); + } + } +} + .tableButton { &.root { &.loader{ diff --git a/src/styles/Menu.module.css b/src/styles/Menu.module.css index a1b72d0..07d214a 100644 --- a/src/styles/Menu.module.css +++ b/src/styles/Menu.module.css @@ -1,9 +1,13 @@ .dropdown { color: var(--color-text-pri); + width: 500px !important; } .item { &:hover { background-color: var(--color-text-pri); color: var(--color-background) } +} +.label { + color: var(--color-text-pri) !important; } \ No newline at end of file diff --git a/src/styles/Select.module.css b/src/styles/Select.module.css index 13380ab..194e2b0 100644 --- a/src/styles/Select.module.css +++ b/src/styles/Select.module.css @@ -10,30 +10,48 @@ &:focus { border-color: var(--color-text-pri) !important; } + display: flex !important; + overflow: clip !important; + height: 36px !important; } .options { .option { - color: black !important; + color: var(--color-text-pri) !important; font-size: 14px !important; /* applies styles to selected item */ &[data-checked] { - background-color: gray !important; - color: white !important; + background-color: var(--color-text-acc) !important; + color: var(--color-text-pri) !important; &:hover { - background-color: black !important; - color: white !important; + background-color: var(--color-text-acc) !important; + color: var(--color-background) !important; } } /* applies styles to hovered item (with mouse or keyboard) */ &:hover { - background-color: black !important; - color: white !important; + background-color: var(--color-text-acc) !important; + color: var(--color-text-pri) !important; } } } .dropdown { - background-color: white !important; + background-color: var(--color-background) !important; +} + +.pillsList { + .pill { + display: none !important; + } +} + +.placeholder { + color: white !important; +} + +.root { + + width: 180px !important; } \ No newline at end of file