Use active theme as default value when creating new custom theme

This commit is contained in:
schroda
2026-01-18 19:12:59 +01:00
parent 54e9f6f9bc
commit 9e621edbf4
2 changed files with 28 additions and 50 deletions

View File

@@ -27,11 +27,7 @@ import { MangaType } from '@/lib/graphql/generated/graphql.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { CategorySelect } from '@/features/category/components/CategorySelect.tsx';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import { useAppThemeContext } from '@/features/theme/AppThemeContext.tsx';
import { createAppColorTheme } from '@/features/theme/services/ThemeCreator.ts';
import { getTheme } from '@/features/theme/services/AppThemes.ts';
import { ThemeCreationDialog } from '@/features/theme/components/CreateThemeDialog.tsx';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
interface IProps {
manga: Pick<MangaType, 'id' | 'inLibrary' | 'sourceId' | 'title'>;
@@ -45,7 +41,6 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
const theme = useTheme();
const isLargeScreen = useMediaQuery(theme.breakpoints.up('sm'));
const { settings } = useMetadataServerSettings();
const { dynamicColor, appTheme, shouldUsePureBlackMode, themeMode } = useAppThemeContext();
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const open = Boolean(anchorEl);
@@ -60,17 +55,6 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
const saveDynamicColorTheme = () => {
AwaitableComponent.show(ThemeCreationDialog, {
mode: 'save_dynamic',
appTheme: {
id: '',
getName: () => '',
isCustom: true,
muiTheme: createAppColorTheme(
getTheme(appTheme, settings.customThemes).muiTheme,
dynamicColor,
shouldUsePureBlackMode,
MediaQuery.getThemeMode(themeMode),
),
},
});
};