@coin-voyage/paykit
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
18 lines (17 loc) • 532 B
JavaScript
import React, { createContext, createElement } from "react";
const Context = createContext(null);
export function ThemeProvider({ children, theme = "auto", mode = "auto", customTheme }) {
const value = {
theme,
mode,
customTheme,
};
return createElement(Context.Provider, { value }, children);
}
export const useThemeContext = () => {
const context = React.useContext(Context);
if (!context) {
throw Error("ThemeProvider must be inside a Provider.");
}
return context;
};