fix(useMonacoTheme): return theme ID instead of the full theme object

This commit is contained in:
cfngc4594 2025-03-20 14:47:16 +08:00
parent 783b8415ea
commit 458bdfbf42
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ export default function MdxPreview({ source }: MdxPreviewProps) {
[
rehypePretty,
{
theme: currentTheme.id,
theme: currentTheme,
keepBackground: false,
},
],

View File

@ -5,7 +5,7 @@ import { MonacoThemeConfig } from "@/config/monaco-theme";
export function useMonacoTheme() {
const { resolvedTheme } = useTheme();
const currentTheme = resolvedTheme === "light" ? MonacoThemeConfig[MonacoTheme.GitHubLightDefault] : MonacoThemeConfig[MonacoTheme.GitHubDarkDefault];
const currentTheme = resolvedTheme === "light" ? MonacoThemeConfig[MonacoTheme.GitHubLightDefault].id : MonacoThemeConfig[MonacoTheme.GitHubDarkDefault].id;
return {
currentTheme,