mirror of https://github.com/morpheus65535/bazarr
19 lines
389 B
TypeScript
19 lines
389 B
TypeScript
import { createContext, useContext } from "react";
|
|
|
|
const NavbarContext = createContext<{
|
|
showed: boolean;
|
|
show: (showed: boolean) => void;
|
|
} | null>(null);
|
|
|
|
export function useNavbar() {
|
|
const context = useContext(NavbarContext);
|
|
|
|
if (context === null) {
|
|
throw new Error("NavbarShowedContext not initialized");
|
|
}
|
|
|
|
return context;
|
|
}
|
|
|
|
export default NavbarContext.Provider;
|