mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
13 lines
369 B
TypeScript
13 lines
369 B
TypeScript
import { useContext } from "react";
|
|
// mobx store
|
|
import { ThemeContext } from "lib/theme-provider";
|
|
// types
|
|
import { IThemeStore } from "store/theme.store";
|
|
|
|
export const useAppTheme = (): IThemeStore => {
|
|
const context = useContext(ThemeContext);
|
|
if (context === undefined)
|
|
throw new Error("useTheme must be used within ThemeProvider");
|
|
return context;
|
|
};
|