diff --git a/src/App.tsx b/src/App.tsx index 5b60ca0..ea12084 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,7 @@ import { DEFAULT_THEME, MantineProvider, + colorsTuple, createTheme, mergeMantineTheme, } from '@mantine/core'; @@ -13,7 +14,7 @@ import { createBrowserRouter, createRoutesFromElements, } from 'react-router-dom'; -import { Loading, MainLayout, ThemeProvider } from './components'; +import { Loading, MainLayout } from './components'; import '@mantine/core/styles.css'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import './index.css'; @@ -32,11 +33,18 @@ function App() { useCommonHooks(); const [loaded, setLoaded] = useState(false); const overrides = createTheme({ + primaryColor: 'primary', + colors: { + primary: colorsTuple(theme.primaryColor), + accent: colorsTuple(theme.accentColor), + background: colorsTuple(theme.backgroundColor), + border: colorsTuple(theme.borderColor), + search: colorsTuple(theme.searchColor), + }, white: theme?.backgroundColor, fontFamily: '-apple-system,Jost,BlinkMacSystemFont,Helvetica Neue,Roboto,sans-serif', }); const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides); - const router = createBrowserRouter( createRoutesFromElements( @@ -104,12 +112,10 @@ function App() { <> {theme && ( - - - - - - + + + + )} diff --git a/src/components/HelpModal/HelpModal.tsx b/src/components/HelpModal/HelpModal.tsx index 90c26a6..7868ecf 100644 --- a/src/components/HelpModal/HelpModal.tsx +++ b/src/components/HelpModal/HelpModal.tsx @@ -21,7 +21,7 @@ export function HelpModal({ applicationData: Application[]; providerData: Provider[]; }) { - const { theme, isMobile, modalStyle } = useCommonHooks(); + const { isMobile } = useCommonHooks(); return ( { diff --git a/src/components/HelpModal/HelpSection.tsx b/src/components/HelpModal/HelpSection.tsx index b886287..3b5add7 100644 --- a/src/components/HelpModal/HelpSection.tsx +++ b/src/components/HelpModal/HelpSection.tsx @@ -1,10 +1,8 @@ import { Divider, Group } from '@mantine/core'; -import { useCommonHooks } from 'hooks'; import type { SearchShortcut } from 'types'; import HintItem from './HintItem'; function HelpSection({ name, items }: { name: string; items: SearchShortcut[] }) { - const { theme } = useCommonHooks(); return ( <>

{name}

- + + ); diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx deleted file mode 100644 index a2d4da4..0000000 --- a/src/components/ThemeProvider.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Box } from '@mantine/core'; -import type { Theme } from 'types'; - -export function ThemeProvider({ - theme, - children, -}: { theme: Theme; children: React.ReactNode }) { - return ( - - {children} - - ); -} diff --git a/src/components/WeatherModal/CurrentWeather.tsx b/src/components/WeatherModal/CurrentWeather.tsx index 5b40579..b8dea97 100644 --- a/src/components/WeatherModal/CurrentWeather.tsx +++ b/src/components/WeatherModal/CurrentWeather.tsx @@ -39,8 +39,8 @@ export default function CurrentWeather({ current }: { current: CW }) { justify='space-between' style={{ width: '100%', - color: 'var(--color-text-pri)', - backgroundColor: 'var(--color-search-background)', + color: 'var(--mantine-color-primary-0)', + backgroundColor: 'var(--mantine-color-search-0)', padding: '1rem', borderRadius: '8px', paddingBottom: '.5rem', diff --git a/src/components/WeatherModal/ExtendedForecastCard.tsx b/src/components/WeatherModal/ExtendedForecastCard.tsx index b312925..e9598fc 100644 --- a/src/components/WeatherModal/ExtendedForecastCard.tsx +++ b/src/components/WeatherModal/ExtendedForecastCard.tsx @@ -14,7 +14,7 @@ export default function ExtendedForecastCard({ w={'100%'} justify='space-between' style={{ - backgroundColor: 'var(--color-search-background)', + backgroundColor: 'var(--mantine-color-search-0)', padding: '1rem', borderRadius: '8px', paddingBottom: '.5rem', @@ -43,7 +43,7 @@ export default function ExtendedForecastCard({ key={item.name} gap={0} align='center' - bg={'var(--color-background)'} + bg={'var(--mantine-color-background-0)'} style={{ borderRadius: '8px', }} diff --git a/src/components/WeatherModal/WeatherGraphs.tsx b/src/components/WeatherModal/WeatherGraphs.tsx index b61e9a7..29a6721 100644 --- a/src/components/WeatherModal/WeatherGraphs.tsx +++ b/src/components/WeatherModal/WeatherGraphs.tsx @@ -20,7 +20,7 @@ export default function WeatherGraphs({ return ( { return new Date(data.startTime).toLocaleTimeString('en-US', { hour: 'numeric', @@ -59,7 +59,7 @@ export default function WeatherGraphs({ }} /> @@ -70,8 +70,8 @@ export default function WeatherGraphs({ type='monotone' name='Temperature' dataKey='temperature' - stroke={'var(--color-text-pri)'} - dot={{ stroke: 'var(--color-text-pri)', strokeWidth: 1 }} + stroke={'var(--mantine-color-primary-0)'} + dot={{ stroke: 'var(--mantine-color-primary-0)', strokeWidth: 1 }} /> { return (data.dewpoint.value * 9) / 5 + 32; }} - stroke={'var(--color-text-acc)'} - dot={{ stroke: 'var(--color-text-pri)', strokeWidth: 1 }} + stroke={'var(--mantine-color-accent-0)'} + dot={{ stroke: 'var(--mantine-color-primary-0)', strokeWidth: 1 }} /> - + { return new Date(data.startTime).toLocaleTimeString('en-US', { hour: 'numeric', @@ -98,7 +98,7 @@ export default function WeatherGraphs({ }); }} /> - + } /> { return data.probabilityOfPrecipitation.value; }} - stroke={'var(--color-text-pri)'} - fill={'var(--color-text-pri)'} - dot={{ stroke: 'var(--color-text-pri)', strokeWidth: 1 }} + stroke={'var(--mantine-color-primary-0)'} + fill={'var(--mantine-color-primary-0)'} + dot={{ stroke: 'var(--mantine-color-primary-0)', strokeWidth: 1 }} /> { return data.relativeHumidity.value; }} - stroke={'var(--color-text-acc)'} - fill={'var(--color-text-acc)'} - dot={{ stroke: 'var(--color-text-pri)', strokeWidth: 1 }} + stroke={'var(--mantine-color-accent-0)'} + fill={'var(--mantine-color-accent-0)'} + dot={{ stroke: 'var(--mantine-color-primary-0)', strokeWidth: 1 }} /> - + diff --git a/src/components/WeatherModal/WeatherModal.tsx b/src/components/WeatherModal/WeatherModal.tsx index c28f328..339beb6 100644 --- a/src/components/WeatherModal/WeatherModal.tsx +++ b/src/components/WeatherModal/WeatherModal.tsx @@ -26,7 +26,7 @@ export function WeatherModal({ setProviderURL: (url: string) => void; closeWeatherModal: () => void; }) { - const { isMobile, currentUser, currentLocation, modalStyle } = useCommonHooks(); + const { isMobile, currentUser, currentLocation } = useCommonHooks(); const { data: hourly } = useWeatherAPI({ endpoint: 'hourly', office: currentLocation.office, @@ -54,7 +54,6 @@ export function WeatherModal({ setProviderURL('https://www.google.com/search?q='); closeWeatherModal(); }} - style={modalStyle} closeOnEscape closeOnClickOutside > @@ -62,7 +61,10 @@ export function WeatherModal({ - + Weather Forecast for{' '} diff --git a/src/components/index.ts b/src/components/index.ts index 4afbd2e..d66a9bd 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,4 @@ export { HelpModal } from './HelpModal/HelpModal'; export { WeatherModal } from './WeatherModal/WeatherModal'; -export { ThemeProvider } from './ThemeProvider'; export { MainLayout } from './MainLayout'; export { Loading } from './Loading'; diff --git a/src/hooks/useCommonHooks.ts b/src/hooks/useCommonHooks.ts index d584e06..6a6ddfe 100644 --- a/src/hooks/useCommonHooks.ts +++ b/src/hooks/useCommonHooks.ts @@ -72,15 +72,6 @@ export function useCommonHooks() { }, }); - const modalStyle = { - '--color-text-pri': theme?.primaryColor, - '--color-text-acc': theme?.accentColor, - '--color-background': theme?.backgroundColor, - '--color-border': theme?.borderColor, - '--color-search-background': theme?.searchColor, - '--image-background': `url(${theme?.backgroundImage})`, - }; - const urlPattern = new RegExp( '^(https?:\\/\\/)?' + // protocol '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name @@ -131,7 +122,6 @@ export function useCommonHooks() { isMobile, theme, setTheme, - modalStyle, urlPattern, fixDigits, reorder, diff --git a/src/pages/homepage/components/Search/Search.tsx b/src/pages/homepage/components/Search/Search.tsx index 6ba18b8..e0c45a8 100644 --- a/src/pages/homepage/components/Search/Search.tsx +++ b/src/pages/homepage/components/Search/Search.tsx @@ -325,7 +325,7 @@ export default function Search({ )} - {item.option.searchTerm} + {item.option.searchTerm} - {item.option.searchTerm} + {item.option.searchTerm} Nothing found...} + nothingFoundMessage={ + Nothing found... + } data-active={searchValue !== ''} dropdownOpened={dropdownOpened} comboboxProps={{ - withinPortal: false, transitionProps: { transition: 'fade', duration: 200 }, }} spellCheck='true' diff --git a/src/pages/homepage/components/SettingsButton/SettingsButton.tsx b/src/pages/homepage/components/SettingsButton/SettingsButton.tsx index 72556c6..cdece57 100644 --- a/src/pages/homepage/components/SettingsButton/SettingsButton.tsx +++ b/src/pages/homepage/components/SettingsButton/SettingsButton.tsx @@ -114,7 +114,6 @@ function SettingsButton() { @@ -183,7 +182,10 @@ function SettingsButton() { options: selectClasses.menuSelectOptions, option: selectClasses.menuSelectOption, }} - comboboxProps={{ withinPortal: false }} + comboboxProps={{ + withinPortal: false, + width: 'fit-content', + }} /> Themes - + { setCurrentTheme( @@ -219,13 +225,17 @@ function SettingsButton() { - + { setCurrentThemePlaylist('All'); @@ -266,7 +276,10 @@ function SettingsButton() { options: selectClasses.menuSelectOptions, option: selectClasses.menuSelectOption, }} - comboboxProps={{ withinPortal: false }} + comboboxProps={{ + withinPortal: false, + width: 'fit-content', + }} onChange={(_value, option: ComboboxItem) => { setCurrentThemePlaylist(option.value); if (option.value !== 'Time of Day') { @@ -309,8 +322,8 @@ function SettingsButton() { position: 'absolute', left: '-12px', top: '-8px', - backgroundColor: theme.primaryColor, - color: theme.backgroundColor, + backgroundColor: 'var(--mantine-color-primary-0)', + color: 'var(--mantine-color-background-0)', }} > Apps @@ -349,7 +362,9 @@ function SettingsButton() { setAppFilter(data); }} classNames={multiSelectClasses} - comboboxProps={{ withinPortal: false }} + comboboxProps={{ + withinPortal: false, + }} /> { setBookmarkSort(option.value); }} diff --git a/src/pages/settings/components/Applications/AppSettingsItem.tsx b/src/pages/settings/components/Applications/AppSettingsItem.tsx index b3a400a..7c95614 100644 --- a/src/pages/settings/components/Applications/AppSettingsItem.tsx +++ b/src/pages/settings/components/Applications/AppSettingsItem.tsx @@ -20,11 +20,13 @@ function AppSettingsItem({ const Icon = allIcons[icon]; const [textDecoration, setTextDecoration] = useState('none'); const [hover, setHover] = useState(false); - const { isMobile, theme } = useCommonHooks(); + const { isMobile } = useCommonHooks(); return ( {enabled === 0 && ( - This app is disabled}> + This app is disabled} + > { }); const [applications, setApplications] = useState([]); const [applicationList, setApplicationList] = useState([]); - const { theme, isMobile, reorder } = useCommonHooks(); + const { isMobile, reorder } = useCommonHooks(); const [newApplication, setNewApplication] = useState(defaultApplication); const { mutateAsync } = useMutationAPI(); const [searchValue, setSearchValue] = useState(''); @@ -179,7 +179,6 @@ const ApplicationSettings = () => { defaultValue={newApplication.icon} comboboxProps={{ zIndex: 3000, - withinPortal: false, }} onChange={(value: string | null) => { setNewApplication({ @@ -304,14 +303,14 @@ const ApplicationSettings = () => { - + Name { style={{ borderRadius: '4px', paddingLeft: '8px', - color: theme.primaryColor, - backgroundColor: theme.searchColor, + color: 'var(--mantine-color-primary-0)', + backgroundColor: 'var(--mantine-color-search-0)', }} > {app.name} - + Filter Name { style={{ borderRadius: '4px', paddingLeft: '8px', - color: theme.primaryColor, - backgroundColor: theme.searchColor, + color: 'var(--mantine-color-primary-0)', + backgroundColor: 'var(--mantine-color-search-0)', }} > {app.filterName} @@ -367,7 +366,6 @@ const ApplicationSettings = () => { diff --git a/src/pages/settings/components/Applications/DebouncedApplication.tsx b/src/pages/settings/components/Applications/DebouncedApplication.tsx index 768ddb3..a1c1e7d 100644 --- a/src/pages/settings/components/Applications/DebouncedApplication.tsx +++ b/src/pages/settings/components/Applications/DebouncedApplication.tsx @@ -24,7 +24,7 @@ function DebouncedApplication({ setIsOpen, allIcons, }: { application: Application; setIsOpen: (isOpen: boolean) => void; allIcons: any }) { - const { theme, handleDelete } = useCommonHooks(); + const { handleDelete } = useCommonHooks(); const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); const { mutateAsync } = useMutationAPI(); @@ -63,8 +63,8 @@ function DebouncedApplication({ padding: '8px', margin: '8px', borderRadius: '10px', - backgroundColor: 'var(--color-text-acc)', - color: 'var(--color-background)', + backgroundColor: 'var(--mantine-color-accent-0)', + color: 'var(--mantine-color-background-0)', }} >{`"${app.name}"`} This action cannot be undone! @@ -72,8 +72,8 @@ function DebouncedApplication({ } /> { setUpdate({ diff --git a/src/pages/settings/components/Bookmarks/BookmarkSettingsItem.tsx b/src/pages/settings/components/Bookmarks/BookmarkSettingsItem.tsx index 40ead35..ffdcee9 100644 --- a/src/pages/settings/components/Bookmarks/BookmarkSettingsItem.tsx +++ b/src/pages/settings/components/Bookmarks/BookmarkSettingsItem.tsx @@ -10,8 +10,8 @@ function BookmarkSettingsItem({ bookmark }: { bookmark: Bookmark }) { style={{ cursor: 'pointer', borderRadius: '4px', - color: 'var(--color-text-acc)', - backgroundColor: 'var(--color-search-background)', + color: 'var(--mantine-color-accent-0)', + backgroundColor: 'var(--mantine-color-search-0)', padding: '8px', }} onMouseEnter={() => setHover(true)} @@ -25,7 +25,7 @@ function BookmarkSettingsItem({ bookmark }: { bookmark: Bookmark }) { style={{ position: 'absolute', right: 24, - color: 'var(--color-text-acc)', + color: 'var(--mantine-color-accent-0)', }} > diff --git a/src/pages/settings/components/Bookmarks/Bookmarks.tsx b/src/pages/settings/components/Bookmarks/Bookmarks.tsx index 47eded0..f93da5c 100644 --- a/src/pages/settings/components/Bookmarks/Bookmarks.tsx +++ b/src/pages/settings/components/Bookmarks/Bookmarks.tsx @@ -28,7 +28,7 @@ const BookmarkSettings = () => { const [groups, setGroups] = useState([]); const [newGroup, setNewGroup] = useState(defaultGroup); const [groupList, setGroupList] = useState([]); - const { theme, isMobile, reorder } = useCommonHooks(); + const { isMobile, reorder } = useCommonHooks(); const { mutateAsync } = useMutationAPI(); const [searchValue, setSearchValue] = useState(''); const [debouncedGroupSearch] = useDebouncedValue(searchValue, 500); @@ -227,14 +227,14 @@ const BookmarkSettings = () => { - + Name { style={{ borderRadius: '4px', paddingLeft: '8px', - color: theme.primaryColor, - backgroundColor: theme.searchColor, + color: 'var(--mantine-color-primary-0)', + backgroundColor: 'var(--mantine-color-search-0)', }} > {group.categoryName} - + Filter Name { style={{ borderRadius: '4px', paddingLeft: '8px', - color: theme.primaryColor, - backgroundColor: theme.searchColor, + color: 'var(--mantine-color-primary-0)', + backgroundColor: 'var(--mantine-color-search-0)', }} > {group.filterName} diff --git a/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx b/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx index 9daef92..38e0593 100644 --- a/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx +++ b/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx @@ -11,7 +11,7 @@ function DebouncedBookmarkItem({ bookmarkItem, setIsOpen, }: { bookmarkItem: Bookmark; setIsOpen: (isOpen: boolean) => void }) { - const { theme, handleDelete } = useCommonHooks(); + const { handleDelete } = useCommonHooks(); const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); const { mutateAsync } = useMutationAPI(); @@ -50,8 +50,8 @@ function DebouncedBookmarkItem({ padding: '8px', margin: '8px', borderRadius: '10px', - backgroundColor: 'var(--color-text-acc)', - color: 'var(--color-background)', + backgroundColor: 'var(--mantine-color-accent-0)', + color: 'var(--mantine-color-background-0)', }} >{`"${bookmark.name}"`} This action cannot be undone! @@ -60,8 +60,8 @@ function DebouncedBookmarkItem({ title='Delete Bookmark' /> {`"${group.categoryName}"`} @@ -124,14 +124,18 @@ function DebouncedGroupSettingsItem({ } /> - + - + - + Bookmark - + @@ -320,7 +308,7 @@ function DebouncedGroupSettingsItem({ label={'Name'} labelProps={{ style: { - color: theme.primaryColor, + color: 'var(--mantine-color-primary-0)', }, }} className={textInputClasses.settingsItem} @@ -337,7 +325,7 @@ function DebouncedGroupSettingsItem({ label={'Category'} labelProps={{ style: { - color: theme.primaryColor, + color: 'var(--mantine-color-primary-0)', }, }} className={textInputClasses.settingsItem} @@ -358,7 +346,7 @@ function DebouncedGroupSettingsItem({ label={'URL'} labelProps={{ style: { - color: theme.primaryColor, + color: 'var(--mantine-color-primary-0)', }, }} className={textInputClasses.settingsItem} diff --git a/src/pages/settings/components/Messages/DebouncedMessage.tsx b/src/pages/settings/components/Messages/DebouncedMessage.tsx index d0a928f..a0b2c30 100644 --- a/src/pages/settings/components/Messages/DebouncedMessage.tsx +++ b/src/pages/settings/components/Messages/DebouncedMessage.tsx @@ -15,7 +15,7 @@ function DebouncedMessage({ message: Message; setMessage: (message: Message) => void; }) { - const { theme, handleDelete } = useCommonHooks(); + const { handleDelete } = useCommonHooks(); const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); return ( @@ -34,8 +34,8 @@ function DebouncedMessage({ padding: '8px', margin: '8px', borderRadius: '10px', - backgroundColor: 'var(--color-text-acc)', - color: 'var(--color-background)', + backgroundColor: 'var(--mantine-color-accent-0)', + color: 'var(--mantine-color-background-0)', }} >{`"${message.message}"`} This action cannot be undone! @@ -43,8 +43,8 @@ function DebouncedMessage({ } /> void; }) { - const { theme, handleDelete } = useCommonHooks(); + const { handleDelete } = useCommonHooks(); const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); const { mutateAsync } = useMutationAPI(); @@ -56,8 +56,8 @@ function DebouncedSearchProvider({ padding: '8px', margin: '8px', borderRadius: '10px', - backgroundColor: 'var(--color-text-acc)', - color: 'var(--color-background)', + backgroundColor: 'var(--mantine-color-accent-0)', + color: 'var(--mantine-color-background-0)', }} >{`"${provider.name}"`} This action cannot be undone! @@ -65,8 +65,8 @@ function DebouncedSearchProvider({ } /> { diff --git a/src/pages/settings/components/Shared/AddItemModal.tsx b/src/pages/settings/components/Shared/AddItemModal.tsx index 0a34084..f8ba530 100644 --- a/src/pages/settings/components/Shared/AddItemModal.tsx +++ b/src/pages/settings/components/Shared/AddItemModal.tsx @@ -14,7 +14,7 @@ function AddItemModal({ body: React.ReactNode; title: string; }) { - const { isMobile, modalStyle } = useCommonHooks(); + const { isMobile } = useCommonHooks(); return ( void; searchPlaceholder: string | undefined; }) { - const { isMobile, theme, modalStyle } = useCommonHooks(); + const { isMobile } = useCommonHooks(); return ( {title} - + @@ -99,7 +91,8 @@ function SettingsHeader({ className={textClasses.settingsTooltip} classNames={textClasses} highlightStyles={{ - backgroundImage: `linear-gradient(45deg, ${theme.accentColor}, ${theme.primaryColor})`, + backgroundImage: + 'linear-gradient(45deg, var(--mantine-color-accent-0), var(--mantine-color-primary-0))', fontWeight: 700, WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', diff --git a/src/pages/settings/components/Theming/ThemeCard.tsx b/src/pages/settings/components/Theming/ThemeCard.tsx index 00c1665..208e19a 100644 --- a/src/pages/settings/components/Theming/ThemeCard.tsx +++ b/src/pages/settings/components/Theming/ThemeCard.tsx @@ -58,8 +58,8 @@ function ThemeCard({ padding: '8px', margin: '8px', borderRadius: '10px', - backgroundColor: 'var(--color-text-acc)', - color: 'var(--color-background)', + backgroundColor: 'var(--mantine-color-accent-0)', + color: 'var(--mantine-color-background-0)', }} >{`"${cardTheme.name}"`} This action cannot be undone! @@ -205,12 +205,13 @@ function ThemeCard({ position: 'absolute', left: 0, top: 27 - shiftEdit, - backgroundColor: shiftEdit === 0 ? 'white' : 'var(--color-background)', + backgroundColor: + shiftEdit === 0 ? 'white' : 'var(--mantine-color-background-0)', borderRadius: '50%', padding: '8px', margin: '4px', border: 'solid 2px', - borderColor: shiftEdit === 0 ? 'black' : 'var(--color-text-pri)', + borderColor: shiftEdit === 0 ? 'black' : 'var(--mantine-color-primary-0)', transition: 'all 0.2s', }} > @@ -221,7 +222,7 @@ function ThemeCard({ style={{ fontSize: '2em', fontWeight: 'bold', - color: shiftEdit === 0 ? 'black' : 'var(--color-text-pri)', + color: shiftEdit === 0 ? 'black' : 'var(--mantine-color-primary-0)', }} /> @@ -241,12 +242,14 @@ function ThemeCard({ position: 'absolute', right: 0, top: 27 - shiftShuffle, - backgroundColor: shiftShuffle === 0 ? 'white' : 'var(--color-background)', + backgroundColor: + shiftShuffle === 0 ? 'white' : 'var(--mantine-color-background-0)', borderRadius: '50%', padding: '8px', margin: '4px', border: 'solid 2px', - borderColor: shiftShuffle === 0 ? 'black' : 'var(--color-text-pri)', + borderColor: + shiftShuffle === 0 ? 'black' : 'var(--mantine-color-primary-0)', transition: 'all 0.2s', }} > @@ -265,7 +268,7 @@ function ThemeCard({ style={{ fontSize: '2em', fontWeight: 'bold', - color: shiftShuffle === 0 ? 'black' : 'var(--color-text-pri)', + color: shiftShuffle === 0 ? 'black' : 'var(--mantine-color-primary-0)', }} /> diff --git a/src/pages/settings/components/Theming/ThemeModal.tsx b/src/pages/settings/components/Theming/ThemeModal.tsx index ca36fd1..f89b627 100644 --- a/src/pages/settings/components/Theming/ThemeModal.tsx +++ b/src/pages/settings/components/Theming/ThemeModal.tsx @@ -47,7 +47,7 @@ function ThemeModal({ closePicker: () => void; handleSaveTheme: () => void; }) { - const { theme, isMobile } = useCommonHooks(); + const { isMobile } = useCommonHooks(); const viewportRef = useRef(null); const [query, setQuery] = useState(''); const [hovered, setHovered] = useState(-1); @@ -101,7 +101,7 @@ function ThemeModal({ padding: 8, marginTop: 34, borderTopLeftRadius: 4, - color: theme.accentColor, + color: 'var(--mantine-color-accent-0)', }} > {re.exec(item.toUpperCase())?.[1]} @@ -130,20 +130,12 @@ function ThemeModal({ onClose={handleClose} fullScreen={isMobile} centered - style={{ - '--color-text-pri': theme.primaryColor, - '--color-text-acc': theme.accentColor, - '--color-background': theme.backgroundColor, - '--color-border': theme.borderColor, - '--color-search-background': theme.searchColor, - '--image-background': `url("${theme.backgroundImage}")`, - }} > - Name: + Name: @@ -255,7 +247,7 @@ function ThemeModal({ color={selectedTheme.primaryColor} style={{ cursor: 'pointer', - border: `2px dashed ${theme.primaryColor}`, + border: '2px dashed var(--mantine-color-primary-0)', }} /> @@ -274,7 +266,7 @@ function ThemeModal({ color={selectedTheme.accentColor} style={{ cursor: 'pointer', - border: `2px dashed ${theme.primaryColor}`, + border: '2px dashed var(--mantine-color-primary-0)', }} /> @@ -293,7 +285,7 @@ function ThemeModal({ color={selectedTheme.backgroundColor} style={{ cursor: 'pointer', - border: `2px dashed ${theme.primaryColor}`, + border: '2px dashed var(--mantine-color-primary-0)', }} /> @@ -312,7 +304,7 @@ function ThemeModal({ color={selectedTheme.borderColor} style={{ cursor: 'pointer', - border: `2px dashed ${theme.primaryColor}`, + border: '2px dashed var(--mantine-color-primary-0)', }} /> @@ -331,7 +323,7 @@ function ThemeModal({ color={selectedTheme.searchColor} style={{ cursor: 'pointer', - border: `2px dashed ${theme.primaryColor}`, + border: '2px dashed var(--mantine-color-primary-0)', }} /> diff --git a/src/pages/settings/components/Theming/ThemeModalContent.tsx b/src/pages/settings/components/Theming/ThemeModalContent.tsx index f079895..28b071b 100644 --- a/src/pages/settings/components/Theming/ThemeModalContent.tsx +++ b/src/pages/settings/components/Theming/ThemeModalContent.tsx @@ -5,7 +5,7 @@ import { stackClasses } from 'styles'; import type { Theme } from 'types'; export default function ThemeModalContent({ selectedTheme }: { selectedTheme: Theme }) { - const ExampleApp = ({ theme }: { theme: Theme }) => { + const ExampleApp = () => { const [textDecoration, setTextDecoration] = useState('none'); return ( @@ -23,7 +23,11 @@ export default function ThemeModalContent({ selectedTheme }: { selectedTheme: Th paddingTop: '15px', }} > - + - - - + + + {`"${cardPlaylist.name}"`} This action cannot be undone! @@ -73,12 +73,12 @@ function ThemePlaylistCard({ left: 6, paddingRight: 4, paddingLeft: 4, - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', borderRadius: '4px', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.backgroundColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-background-0)', zIndex: 3, }} > @@ -92,12 +92,12 @@ function ThemePlaylistCard({ right: 6, paddingRight: 4, paddingLeft: 4, - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', borderRadius: '4px', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.backgroundColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-background-0)', zIndex: 3, }} onClick={(event) => { @@ -160,12 +160,12 @@ function ThemePlaylistCard({ right: 6, paddingRight: 4, paddingLeft: 4, - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', borderRadius: '4px', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.backgroundColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-background-0)', zIndex: 3, }} onClick={() => { @@ -182,12 +182,12 @@ function ThemePlaylistCard({ right: 40, paddingRight: 4, paddingLeft: 4, - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', borderRadius: '4px', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.backgroundColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-background-0)', zIndex: 3, }} onClick={() => { @@ -204,9 +204,9 @@ function ThemePlaylistCard({ h={'320px'} style={{ backgroundSize: 'cover', - backgroundColor: theme.searchColor, - color: theme.accentColor, - border: `solid ${theme.borderColor}`, + backgroundColor: 'var(--mantine-color-search-0)', + color: 'var(--mantine-color-accent-0)', + border: 'solid var(--mantine-color-border-0)', }} onClick={() => { setCurrentThemePlaylist(cardPlaylist.name); @@ -222,8 +222,8 @@ function ThemePlaylistCard({ mt={8} mb={-8} style={{ - color: theme.backgroundColor, - backgroundColor: theme.primaryColor, + color: 'var(--mantine-color-background-0)', + backgroundColor: 'var(--mantine-color-primary-0)', borderRadius: '4px', }} > @@ -249,8 +249,8 @@ function ThemePlaylistCard({ mt={8} mb={-8} style={{ - color: theme.backgroundColor, - backgroundColor: theme.primaryColor, + color: 'var(--mantine-color-background-0)', + backgroundColor: 'var(--mantine-color-primary-0)', borderRadius: '4px', }} > diff --git a/src/pages/settings/components/Theming/ThemePlaylistModal.tsx b/src/pages/settings/components/Theming/ThemePlaylistModal.tsx index 126405e..222afd0 100644 --- a/src/pages/settings/components/Theming/ThemePlaylistModal.tsx +++ b/src/pages/settings/components/Theming/ThemePlaylistModal.tsx @@ -33,7 +33,7 @@ function ThemePlaylistModal({ handleSavePlaylist: () => void; allThemes: Theme[]; }) { - const { theme, isMobile, modalStyle } = useCommonHooks(); + const { isMobile } = useCommonHooks(); const [themeList, setThemeList] = useState([]); useEffect(() => { @@ -57,13 +57,12 @@ function ThemePlaylistModal({ handleClose(); setThemeList('[]'); }} - style={modalStyle} > - Name: + Name: diff --git a/src/pages/settings/components/Theming/ThemePlaylists.tsx b/src/pages/settings/components/Theming/ThemePlaylists.tsx index eceaf01..dba10d6 100644 --- a/src/pages/settings/components/Theming/ThemePlaylists.tsx +++ b/src/pages/settings/components/Theming/ThemePlaylists.tsx @@ -101,11 +101,11 @@ function ThemePlaylists() { fontSize: '2em', fontWeight: 'bold', borderRadius: '50%', - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.backgroundColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-background-0)', }} /> )} @@ -149,11 +149,11 @@ function ThemePlaylists() { fontSize: '2em', fontWeight: 'bold', borderRadius: '50%', - backgroundColor: theme.borderColor, + backgroundColor: 'var(--mantine-color-border-0)', color: theme.borderColor === theme.primaryColor - ? theme.accentColor - : theme.primaryColor, + ? 'var(--mantine-color-accent-0)' + : 'var(--mantine-color-primary-0)', }} /> )} diff --git a/src/pages/settings/components/Theming/ThemeSelect.tsx b/src/pages/settings/components/Theming/ThemeSelect.tsx index 9eff2fe..4b9df81 100644 --- a/src/pages/settings/components/Theming/ThemeSelect.tsx +++ b/src/pages/settings/components/Theming/ThemeSelect.tsx @@ -30,7 +30,6 @@ function ThemeSelect({ {timeIndex}