diff --git a/src/pages/settings/components/Applications/Applications.tsx b/src/pages/settings/components/Applications/Applications.tsx index ec39b6e..ae7b289 100644 --- a/src/pages/settings/components/Applications/Applications.tsx +++ b/src/pages/settings/components/Applications/Applications.tsx @@ -193,66 +193,70 @@ const ApplicationSettings = () => { - - - Applications - - - - - - - - - - - {'Applications are the apps that will be displayed on the homepage.'} - - + + + Applications + + + + - { - 'Applications contain a name, base url, url, icon and filter. Currently the icon must be the mdi icon name. URLs can contain either http(s):// or not. Base URLs should start with /, otherwise they will cause errors.' - } - - - - - + + + + + + + {'Applications are the apps that will be displayed on the homepage.'} + + + { + 'Applications contain a name, base url, url, icon and filter. Currently the icon must be the mdi icon name. URLs can contain either http(s):// or not. Base URLs should start with /, otherwise they will cause errors.' + } + + + + + + setHover(true)} @@ -21,11 +20,11 @@ function BookmarkSettingsItem({ bookmark }: any) { {bookmark.name} {hover && ( diff --git a/src/pages/settings/components/Bookmarks/Bookmarks.tsx b/src/pages/settings/components/Bookmarks/Bookmarks.tsx index 2e93c68..8517d1d 100644 --- a/src/pages/settings/components/Bookmarks/Bookmarks.tsx +++ b/src/pages/settings/components/Bookmarks/Bookmarks.tsx @@ -145,66 +145,70 @@ const BookmarkSettings = () => { - - - Bookmarks - - - - - - - - - - - {'Bookmarks are the links that will be displayed on the homepage.'} - - + + + Bookmarks + + + + - { - 'Bookmarks can only belong to a single category, and will be displayed under that category on the homepage.' - } - - - - - + + + + + + + {'Bookmarks are the links that will be displayed on the homepage.'} + + + { + 'Bookmarks can only belong to a single category, and will be displayed under that category on the homepage.' + } + + + + + + - Add bookmark + Bookmark { - - - Messages - - - - - - - - - - - {'These custom messages will be displayed in the header on the homepage.'} - - + + + Messages + + + + - { - 'Built-in variables include $firstName and $lastName. To force the text to upper case, use a carat (^), ie, $^firstName. Messages may contain any unicode text.' - } - - - - - + + + + + + + { + 'These custom messages will be displayed in the header on the homepage.' + } + + + { + 'Built-in variables include $firstName and $lastName. To force the text to upper case, use a carat (^), ie, $^firstName. Messages may contain any unicode text.' + } + + + + + + { - - - Search Providers - - - - - - - - - - - {'Search providers and shortcuts can be configured here.'} - - + + + Search Providers + + + + - { - 'Providers can be used in the search bar. By starting a search with the prefix, it will be redirected to the url of the provider to complete the search.' - } - - - - - + + + + + + + {'Search providers and shortcuts can be configured here.'} + + + { + 'Providers can be used in the search bar. By starting a search with the prefix, it will be redirected to the url of the provider to complete the search.' + } + + + + + + @@ -134,7 +134,7 @@ function ThemePlaylistCard({ cardPlaylist, handleOpen, allThemes }: any) { color: theme.borderColor === theme.primaryColor ? theme.accentColor - : theme.primaryColor, + : theme.backgroundColor, zIndex: 3, }} onClick={(event) => { @@ -202,7 +202,7 @@ function ThemePlaylistCard({ cardPlaylist, handleOpen, allThemes }: any) { color: theme.borderColor === theme.primaryColor ? theme.accentColor - : theme.primaryColor, + : theme.backgroundColor, zIndex: 3, }} onClick={() => { @@ -224,7 +224,7 @@ function ThemePlaylistCard({ cardPlaylist, handleOpen, allThemes }: any) { color: theme.borderColor === theme.primaryColor ? theme.accentColor - : theme.primaryColor, + : theme.backgroundColor, zIndex: 3, }} onClick={() => { diff --git a/src/pages/settings/components/Theming/ThemePlaylists.tsx b/src/pages/settings/components/Theming/ThemePlaylists.tsx index acbf9ce..1277535 100644 --- a/src/pages/settings/components/Theming/ThemePlaylists.tsx +++ b/src/pages/settings/components/Theming/ThemePlaylists.tsx @@ -7,12 +7,13 @@ import { Popover, Stack, Text, + TextInput, } from '@mantine/core'; -import { useDisclosure } from '@mantine/hooks'; +import { useDebouncedValue, useDisclosure } from '@mantine/hooks'; import { useCommonHooks, useMutationAPI, useQueryAPI } from 'hooks'; import { useState } from 'react'; import { FiChevronRight, FiHelpCircle, FiPlus } from 'react-icons/fi'; -import { actionIconClasses, buttonClasses, textClasses } from 'styles'; +import { actionIconClasses, buttonClasses, textClasses, textInputClasses } from 'styles'; import ThemePlaylistCard from './ThemePlaylistCard'; import ThemePlaylistModal from './ThemePlaylistModal'; @@ -26,7 +27,10 @@ function ThemePlaylists() { const { mutateAsync } = useMutationAPI(); const [opened, { open, close }] = useDisclosure(false); const [selectedPlaylist, setSelectedPlaylist] = useState({}); - const { currentThemePlaylist, setCurrentThemePlaylist, theme } = useCommonHooks(); + const { currentThemePlaylist, setCurrentThemePlaylist, theme, isMobile } = + useCommonHooks(); + const [searchValue, setSearchValue] = useState(''); + const [debouncedSearch] = useDebouncedValue(searchValue, 500); const handleOpen = (playlist: any) => { setSelectedPlaylist(playlist); @@ -58,8 +62,8 @@ function ThemePlaylists() { createPlaylist={mutateAsync} /> - - + + Theme Playlists @@ -116,6 +120,18 @@ function ThemePlaylists() { + { + setSearchValue(event.target.value); + }} + /> @@ -125,6 +141,9 @@ function ThemePlaylists() { {themePlaylists ?.filter((playlist: any) => playlist.default === 1) + ?.filter((a: any) => + a.name.toLowerCase().includes(debouncedSearch.toLowerCase()), + ) .map((cardPlaylist: any) => { return ( @@ -141,7 +160,7 @@ function ThemePlaylists() { color: theme.borderColor === theme.primaryColor ? theme.accentColor - : theme.primaryColor, + : theme.backgroundColor, }} /> )} @@ -166,6 +185,9 @@ function ThemePlaylists() { {themePlaylists ?.filter((playlist: any) => playlist.default === 0) + ?.filter((a: any) => + a.name.toLowerCase().includes(debouncedSearch.toLowerCase()), + ) .map((cardPlaylist: any) => { return ( diff --git a/src/pages/settings/components/Theming/Themes.tsx b/src/pages/settings/components/Theming/Themes.tsx index 9b6fff7..2e75a19 100644 --- a/src/pages/settings/components/Theming/Themes.tsx +++ b/src/pages/settings/components/Theming/Themes.tsx @@ -9,14 +9,16 @@ import { Stack, Switch, Text, + TextInput, } from '@mantine/core'; -import { useDisclosure } from '@mantine/hooks'; +import { useDebouncedValue, useDisclosure } from '@mantine/hooks'; import { useCommonHooks, useMutationAPI, useQueryAPI } from 'hooks'; import { useEffect, useState } from 'react'; import { FiChevronRight, FiHelpCircle, FiPlus } from 'react-icons/fi'; import '@mantine/core/styles/ModalBase.css'; import '@mantine/core/styles/Modal.css'; -import { actionIconClasses, buttonClasses, textClasses } from 'styles'; +import { FaDice } from 'react-icons/fa'; +import { actionIconClasses, buttonClasses, textClasses, textInputClasses } from 'styles'; import ThemeCard from './ThemeCard'; import ThemeModal from './ThemeModal'; function ThemesSettings() { @@ -33,7 +35,9 @@ function ThemesSettings() { const [backgroundList, setBackgroundList] = useState(['None']); const [selectedTheme, setSelectedTheme] = useState({}); const [pickerOpen, { open: openPicker, close: closePicker }] = useDisclosure(false); - const { currentTheme, setCurrentTheme, theme, setCurrentThemePlaylist } = + const [searchValue, setSearchValue] = useState(''); + const [debouncedSearch] = useDebouncedValue(searchValue, 500); + const { currentTheme, setCurrentTheme, theme, isMobile, setCurrentThemePlaylist } = useCommonHooks(); const handleOpen = (theme: any) => { @@ -79,8 +83,8 @@ function ThemesSettings() { handleSaveTheme={handleSaveTheme} /> - - + + Themes @@ -143,9 +147,30 @@ function ThemesSettings() { + { + setSearchValue(event.target.value); + }} + /> Random Theme} + label={ + isMobile ? ( + + ) : ( + Random Theme + ) + } labelPosition='left' + pos={'absolute'} + right={isMobile ? '2rem' : '1rem'} + top={isMobile ? '9.5rem' : undefined} checked={currentTheme === 'random'} onChange={(e) => { setCurrentTheme(e.target.checked ? 'random' : theme.name); @@ -166,39 +191,45 @@ function ThemesSettings() { }} pos={'absolute'} /> - {allThemes?.map((cardTheme: any) => ( - - {cardTheme.name === currentTheme && ( - + a.name.toLowerCase().includes(debouncedSearch.toLowerCase()), + ) + .map((cardTheme: any) => ( + + {cardTheme.name === currentTheme && ( + + )} + - )} - - - - - ))} + > + + + + ))} diff --git a/src/pages/settings/components/WoL/WolClients.tsx b/src/pages/settings/components/WoL/WolClients.tsx index 5e6080b..2dc9ae8 100644 --- a/src/pages/settings/components/WoL/WolClients.tsx +++ b/src/pages/settings/components/WoL/WolClients.tsx @@ -145,55 +145,59 @@ const WolClientSettings = () => { - - - WoL Clients - - - - - - - - - - - {'Wake on Lan clients can be configured here.'} - - + + + WoL Clients + + + + - {'Clients can be powered on from the settings button the homepage.'} - - - - - + + + + + + + {'Wake on Lan clients can be configured here.'} + + + {'Clients can be powered on from the settings button the homepage.'} + + + + + +