Component library setup (#115)
This commit is contained in:
11
skyvern-frontend/src/components/useTheme.ts
Normal file
11
skyvern-frontend/src/components/useTheme.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { ThemeProviderContext } from "./themeProviderContext";
|
||||
|
||||
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