From 1423ca23be0e4c01ed32e5ac3ea660f856cc6d66 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:59:27 +0200 Subject: [PATCH] Set appbar color on light theme --- src/components/atoms/SearchTextField.tsx | 13 ++++++++++--- .../SelectableCollectionSelectAll.tsx | 8 +++++++- .../SelectableCollectionSelectMode.tsx | 8 +++++++- src/components/library/LibraryToolbarMenu.tsx | 2 +- src/components/library/UpdateChecker.tsx | 7 ++++++- src/components/manga/MangaToolbarMenu.tsx | 5 ++++- src/components/navbar/DefaultNavBar.tsx | 8 +++++--- src/components/source/GridLayouts.tsx | 1 + src/components/tracker/TrackerSearch.tsx | 2 +- src/components/util/AppbarSearch.tsx | 18 +++++++++++++++++- src/components/util/Progress.tsx | 14 +++++++++++--- src/screens/DownloadQueue.tsx | 4 ++-- src/screens/Extensions.tsx | 2 +- src/screens/Library.tsx | 10 +++++----- src/screens/Sources.tsx | 2 +- src/screens/settings/LibraryDuplicates.tsx | 2 +- 16 files changed, 80 insertions(+), 26 deletions(-) diff --git a/src/components/atoms/SearchTextField.tsx b/src/components/atoms/SearchTextField.tsx index 4f034976..68172fcc 100644 --- a/src/components/atoms/SearchTextField.tsx +++ b/src/components/atoms/SearchTextField.tsx @@ -7,19 +7,26 @@ */ import TextField, { TextFieldProps } from '@mui/material/TextField'; -import IconButton from '@mui/material/IconButton'; +import IconButton, { IconButtonProps } from '@mui/material/IconButton'; import InputAdornment from '@mui/material/InputAdornment'; import CancelIcon from '@mui/icons-material/Cancel'; -export const SearchTextField = ({ onCancel, ...textFieldProps }: TextFieldProps & { onCancel: () => void }) => ( +export const SearchTextField = ({ + onCancel, + cancelButtonProps, + ...textFieldProps +}: TextFieldProps & { onCancel: () => void; cancelButtonProps?: IconButtonProps }) => ( - onCancel()}> + onCancel()}> diff --git a/src/components/collection/SelectableCollectionSelectAll.tsx b/src/components/collection/SelectableCollectionSelectAll.tsx index d82aec77..6dfc64fc 100644 --- a/src/components/collection/SelectableCollectionSelectAll.tsx +++ b/src/components/collection/SelectableCollectionSelectAll.tsx @@ -24,7 +24,13 @@ export const SelectableCollectionSelectAll = ({ return ( onChange(checked)} diff --git a/src/components/collection/SelectableCollectionSelectMode.tsx b/src/components/collection/SelectableCollectionSelectMode.tsx index 3840e74b..f99f9903 100644 --- a/src/components/collection/SelectableCollectionSelectMode.tsx +++ b/src/components/collection/SelectableCollectionSelectMode.tsx @@ -39,7 +39,13 @@ export const SelectableCollectionSelectMode = ({ } - sx={{ padding: '8px' }} + sx={{ + padding: '8px', + color: 'inherit', + '&.Mui-checked': { + color: 'inherit', + }, + }} checked={isActive} onChange={(_, checked) => onModeChange(checked)} /> diff --git a/src/components/library/LibraryToolbarMenu.tsx b/src/components/library/LibraryToolbarMenu.tsx index 318e9040..fe8bfde3 100644 --- a/src/components/library/LibraryToolbarMenu.tsx +++ b/src/components/library/LibraryToolbarMenu.tsx @@ -27,7 +27,7 @@ export const LibraryToolbarMenu: React.FC = () => { return ( <> - setOpen(!open)} color={active ? 'warning' : 'default'}> + setOpen(!open)} color={active ? 'warning' : 'inherit'}> diff --git a/src/components/library/UpdateChecker.tsx b/src/components/library/UpdateChecker.tsx index e2391e3a..e974ebd2 100644 --- a/src/components/library/UpdateChecker.tsx +++ b/src/components/library/UpdateChecker.tsx @@ -132,6 +132,7 @@ export function UpdateChecker({ : { onClick: () => onClick() })} onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} + color="inherit" > {!isRunning ? ( @@ -139,7 +140,11 @@ export function UpdateChecker({ <> - + )} diff --git a/src/components/manga/MangaToolbarMenu.tsx b/src/components/manga/MangaToolbarMenu.tsx index 3e08e74c..afdcfcad 100644 --- a/src/components/manga/MangaToolbarMenu.tsx +++ b/src/components/manga/MangaToolbarMenu.tsx @@ -56,6 +56,7 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => { onRefresh(); }} disabled={refreshing} + color="inherit" > @@ -68,7 +69,7 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => { state={{ mangaTitle: manga.title }} style={{ textDecoration: 'none', color: 'inherit' }} > - + @@ -78,6 +79,7 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => { onClick={() => { openCategorySelect(true); }} + color="inherit" > @@ -94,6 +96,7 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => { aria-haspopup="true" aria-expanded={open ? 'true' : undefined} onClick={(e) => setAnchorEl(e.currentTarget)} + color="inherit" > diff --git a/src/components/navbar/DefaultNavBar.tsx b/src/components/navbar/DefaultNavBar.tsx index 4f00de2e..76820088 100644 --- a/src/components/navbar/DefaultNavBar.tsx +++ b/src/components/navbar/DefaultNavBar.tsx @@ -25,6 +25,7 @@ import { useLocation } from 'react-router-dom'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; import MenuIcon from '@mui/icons-material/Menu'; import Stack from '@mui/material/Stack'; +import { useTheme } from '@mui/material/styles'; import { NavbarItem } from '@/typings'; import { NavBarContext } from '@/components/context/NavbarContext'; import { useBackButton } from '@/util/useBackButton.ts'; @@ -76,6 +77,7 @@ export function DefaultNavBar() { const { title, action, override, isCollapsed, setIsCollapsed, setAppBarHeight, navBarWidth, setNavBarWidth } = useContext(NavBarContext); + const theme = useTheme(); const { pathname } = useLocation(); const handleBack = useBackButton(); @@ -123,9 +125,8 @@ export function DefaultNavBar() { position: 'fixed', marginLeft: actualNavBarWidth, width: `calc(100% - ${actualNavBarWidth}px)`, - zIndex: (theme) => theme.zIndex.drawer + 1, + zIndex: theme.zIndex.drawer + 1, }} - color="default" > {!isMobileWidth && ( @@ -138,7 +139,7 @@ export function DefaultNavBar() { alignItems: 'center', }} > - setIsCollapsed(false)}> + setIsCollapsed(false)} color="inherit"> @@ -159,6 +160,7 @@ export function DefaultNavBar() { size="large" aria-label="menu" onClick={handleBack} + color="inherit" > {getOptionForDirection(, )} diff --git a/src/components/source/GridLayouts.tsx b/src/components/source/GridLayouts.tsx index 7e529fd1..f521fed5 100644 --- a/src/components/source/GridLayouts.tsx +++ b/src/components/source/GridLayouts.tsx @@ -50,6 +50,7 @@ export function GridLayouts({ aria-controls={open ? 'account-menu' : undefined} aria-haspopup="true" aria-expanded={open ? 'true' : undefined} + color="inherit" > diff --git a/src/components/tracker/TrackerSearch.tsx b/src/components/tracker/TrackerSearch.tsx index d5adfdd3..e966f98e 100644 --- a/src/components/tracker/TrackerSearch.tsx +++ b/src/components/tracker/TrackerSearch.tsx @@ -119,7 +119,7 @@ export const TrackerSearch = ({ {(popupState) => ( <> - + = (props) => { const { isClosable = true } = props; + const theme = useTheme(); const { t } = useTranslation(); const [prevLocationKey, setPrevLocationKey] = useState(); @@ -103,13 +105,27 @@ export const AppbarSearch: React.FunctionComponent = (props) => { }} onBlur={handleBlur} inputRef={inputRef} + sx={{ + ...theme.applyStyles('light', { + '& .MuiInput-underline:before': { + borderBottomColor: 'primary.contrastText', // Default color + }, + '& .MuiInput-underline:hover:before': { + borderBottomColor: 'primary.contrastText', // Hover color + }, + '& .MuiInput-underline:after': { + borderBottomColor: 'primary.dark', // Focused color + }, + }), + }} + cancelButtonProps={{ sx: { ...theme.applyStyles('light', { color: 'primary.contrastText' }) } }} /> ); } return ( - updateSearchOpenState(true)}> + updateSearchOpenState(true)} color="inherit"> diff --git a/src/components/util/Progress.tsx b/src/components/util/Progress.tsx index 1eac316d..42feeeef 100644 --- a/src/components/util/Progress.tsx +++ b/src/components/util/Progress.tsx @@ -7,12 +7,20 @@ */ import Box from '@mui/material/Box'; -import CircularProgress from '@mui/material/CircularProgress'; +import CircularProgress, { CircularProgressProps } from '@mui/material/CircularProgress'; import Typography from '@mui/material/Typography'; -export const Progress = ({ progress, showText = true }: { progress: number; showText?: boolean }) => ( +export const Progress = ({ + progress, + showText = true, + progressProps = {}, +}: { + progress: number; + showText?: boolean; + progressProps?: CircularProgressProps; +}) => ( - + {showText && ( { setAction( <> - + - + {status === 'STOPPED' ? : } diff --git a/src/screens/Extensions.tsx b/src/screens/Extensions.tsx index ed61018c..36b11ee3 100644 --- a/src/screens/Extensions.tsx +++ b/src/screens/Extensions.tsx @@ -179,7 +179,7 @@ export function Extensions({ tabsMenuHeight }: { tabsMenuHeight: number }) { <> - inputRef.current?.click()} size="large"> + inputRef.current?.click()} size="large" color="inherit"> diff --git a/src/screens/Library.tsx b/src/screens/Library.tsx index 1760ee23..9c9c8342 100644 --- a/src/screens/Library.tsx +++ b/src/screens/Library.tsx @@ -6,10 +6,10 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import Chip from '@mui/material/Chip'; +import Chip, { ChipProps } from '@mui/material/Chip'; import Tab from '@mui/material/Tab'; import { styled } from '@mui/material/styles'; -import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useQueryParam, NumberParam } from 'use-query-params'; import { useTranslation } from 'react-i18next'; import { requestManager } from '@/lib/requests/RequestManager.ts'; @@ -45,8 +45,8 @@ const TitleWithSizeTag = styled('span')({ alignItems: 'center', }); -const TitleSizeTag = (props: React.ComponentProps) => ( - +const TitleSizeTag = ({ sx, ...props }: ChipProps) => ( + ); export function Library() { @@ -152,7 +152,7 @@ export function Library() { const navBarTitle = ( {title} - {options.showTabSize && } + {options.showTabSize && } ); setTitle(navBarTitle, title); diff --git a/src/screens/Sources.tsx b/src/screens/Sources.tsx index 4a560576..d4b11e91 100644 --- a/src/screens/Sources.tsx +++ b/src/screens/Sources.tsx @@ -96,7 +96,7 @@ export function Sources() { setAction( <> - navigate('/sources/all/search/')} size="large"> + navigate('/sources/all/search/')} size="large" color="inherit"> diff --git a/src/screens/settings/LibraryDuplicates.tsx b/src/screens/settings/LibraryDuplicates.tsx index 2f6df433..61dc3457 100644 --- a/src/screens/settings/LibraryDuplicates.tsx +++ b/src/screens/settings/LibraryDuplicates.tsx @@ -126,7 +126,7 @@ export const LibraryDuplicates = () => { {(popupState) => ( <> - +