datahub/datahub-web-react/src/customThemeContext.tsx
John Joyce 69ff9c3af3
infra(ui): Add a react context provider allowing sub-components to update theme conf (#9674)
Co-authored-by: John Joyce <john@Johns-MBP.attlocal.net>
2024-01-25 16:51:40 -08:00

11 lines
288 B
TypeScript

import React, { useContext } from 'react';
export const CustomThemeContext = React.createContext<{
theme: any;
updateTheme: (theme: any) => void;
}>({ theme: undefined, updateTheme: (_) => null });
export function useCustomTheme() {
return useContext(CustomThemeContext);
}