mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
Consolidate ThemeProvider and AppProvider
This commit is contained in:
7 files changed
+199
-145
No files matched your search
+3
-10
@@ -1,13 +1,6 @@
|
||||
import { useContext } from "react"
|
||||
import { ThemeContext, type ThemeContextType } from "@/lib/ThemeContext"
|
||||
import { useTheme as useThemeFromProvider } from "@/components/AppProvider";
|
||||
|
||||
/** Hook to get and set the active theme. */
|
||||
export function useTheme(): ThemeContextType {
|
||||
const context = useContext(ThemeContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error("useTheme must be used within a ThemeProvider");
|
||||
}
|
||||
|
||||
return context;
|
||||
export function useTheme() {
|
||||
return useThemeFromProvider();
|
||||
}
|
||||
Reference in new issue
Block a user