Use active theme as default value when creating new custom theme
This commit is contained in:
@@ -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),
|
||||
),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user