diff --git a/src/config/monaco-theme.ts b/src/config/monaco-theme.ts deleted file mode 100644 index 9dadae5..0000000 --- a/src/config/monaco-theme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { MonacoTheme } from "@/types/monaco-theme"; - -// Define theme configurations -const MonacoThemeConfig = { - [MonacoTheme.GitHubLightDefault]: { - id: MonacoTheme.GitHubLightDefault, - label: "Github Light Default", - }, - [MonacoTheme.GitHubDarkDefault]: { - id: MonacoTheme.GitHubDarkDefault, - label: "Github Dark Default", - }, -}; - -// Default Light and Dark theme configurations -const DefaultLightThemeConfig = MonacoThemeConfig[MonacoTheme.GitHubLightDefault]; -const DefaultDarkThemeConfig = MonacoThemeConfig[MonacoTheme.GitHubDarkDefault]; - -export { MonacoThemeConfig, DefaultLightThemeConfig, DefaultDarkThemeConfig }; diff --git a/src/hooks/use-mobile.tsx b/src/hooks/use-mobile.tsx index 2b0fe1d..48fab93 100644 --- a/src/hooks/use-mobile.tsx +++ b/src/hooks/use-mobile.tsx @@ -1,19 +1,21 @@ -import * as React from "react" +import * as React from "react"; -const MOBILE_BREAKPOINT = 768 +const MOBILE_BREAKPOINT = 768; export function useIsMobile() { - const [isMobile, setIsMobile] = React.useState(undefined) + const [isMobile, setIsMobile] = React.useState( + undefined + ); React.useEffect(() => { - const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) + const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`); const onChange = () => { - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) - } - mql.addEventListener("change", onChange) - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) - return () => mql.removeEventListener("change", onChange) - }, []) + setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); + }; + mql.addEventListener("change", onChange); + setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); + return () => mql.removeEventListener("change", onChange); + }, []); - return !!isMobile + return !!isMobile; } diff --git a/src/hooks/use-monaco-theme.ts b/src/hooks/use-monaco-theme.ts index a83ab28..bdd1b2e 100644 --- a/src/hooks/use-monaco-theme.ts +++ b/src/hooks/use-monaco-theme.ts @@ -1,12 +1,10 @@ import { useTheme } from "next-themes"; -import { DefaultLightThemeConfig, DefaultDarkThemeConfig } from "@/config/monaco-theme"; -export function useMonacoTheme() { +export const useMonacoTheme = () => { const { resolvedTheme } = useTheme(); - const currentTheme = resolvedTheme === "light" ? DefaultLightThemeConfig.id : DefaultDarkThemeConfig.id; + const theme = + resolvedTheme === "light" ? "github-light-default" : "github-dark-default"; - return { - currentTheme, - }; -} + return { theme }; +}; diff --git a/src/types/monaco-theme.ts b/src/types/monaco-theme.ts deleted file mode 100644 index a2195ee..0000000 --- a/src/types/monaco-theme.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum MonacoTheme { - GitHubLightDefault = "github-light-default", - GitHubDarkDefault = "github-dark-default", -} - -export type MonacoThemeMetadata = { - id: MonacoTheme; - label: string; -};