mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 00:14:25 +00:00
Add tests for AuthContext, ModalContext and ThemeContext
This commit is contained in:
@@ -22,13 +22,16 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
|
||||
|
||||
const updateColorScheme = useCallback(
|
||||
(newTheme: MantineColorScheme): void => {
|
||||
setColorScheme(newTheme);
|
||||
if (setColorScheme) {
|
||||
setColorScheme(newTheme);
|
||||
}
|
||||
},
|
||||
[setColorScheme]
|
||||
);
|
||||
|
||||
// Ensure colorScheme is never undefined by falling back to light theme
|
||||
const value: ThemeContextType = {
|
||||
colorScheme,
|
||||
colorScheme: colorScheme || 'light',
|
||||
updateColorScheme,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user