diff --git a/src/pages/homepage/components/SettingsButton.tsx b/src/pages/homepage/components/SettingsButton.tsx index 01ce200..9f46c9f 100644 --- a/src/pages/homepage/components/SettingsButton.tsx +++ b/src/pages/homepage/components/SettingsButton.tsx @@ -4,6 +4,7 @@ import { Group, Menu, MultiSelect, + Overlay, Select, Stack, Text, @@ -43,7 +44,7 @@ function SettingsButton() { } = useCommonHooks(); const [selectedClient, setSelectedClient] = useState(wolClients?.[0]); - + const [overlayOpened, setOverlayOpened] = useState(false); const handleWakeRequest = () => { wakeRequest({ method: 'POST', @@ -63,179 +64,186 @@ function SettingsButton() { }, [data, isFetched]); return ( - - - - - - - - navigate(`/${import.meta.env.VITE_BASE_URL}/settings`)} - style={{ - cursor: 'pointer', - position: 'absolute', - top: '.5rem', - right: isMobile ? undefined : '.5rem', - left: isMobile ? '.5rem' : undefined, - }} - /> - - - - Wake on LAN - + + + + + navigate(`/${import.meta.env.VITE_BASE_URL}/settings`)} + style={{ + cursor: 'pointer', + position: 'absolute', + top: '.5rem', + right: isMobile ? undefined : '.5rem', + left: isMobile ? '.5rem' : undefined, }} + /> + + + - - - - - { + return { + value: wolClient.hostname, + label: `${wolClient.hostname} (${wolClient.macAddress})`, + hostname: wolClient.hostname, + macAddress: wolClient.macAddress, + }; + }) || [] + } + classNames={selectClasses} + comboboxProps={{ withinPortal: false }} + onChange={(_value, option: any) => setSelectedClient(option)} + onLoad={(option: any) => setSelectedClient(option)} + /> + + + Themes + + + { + setCurrentTheme( + currentTheme === 'random' ? theme.name : 'random', + ); + }} + > + + + + + { + handleThemeChange(allThemes, true); + }} + > + + + + + + Currently:{' '} + + {theme.name} + + + - Themes - - - { - setCurrentTheme(currentTheme === 'random' ? theme.name : 'random'); - }} - > - - - - - { - handleThemeChange(allThemes, true); - }} - > - - - + 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 }} + /> - - Currently:{' '} - - {theme.name} - - - - 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 }} - /> - - - - + + + ); }