mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Add ThemeProvider
This commit is contained in:
6 files changed
+163
-11
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { useContext } from "react"
|
||||
import { ThemeProviderContext } from "@/lib/theme-context"
|
||||
|
||||
export const useTheme = () => {
|
||||
const context = useContext(ThemeProviderContext)
|
||||
|
||||
if (context === undefined)
|
||||
throw new Error("useTheme must be used within a ThemeProvider")
|
||||
|
||||
return context
|
||||
}
|
||||
Reference in new issue
Block a user