From 589e53f152d7363074049dfd1bd5a34286ae74d6 Mon Sep 17 00:00:00 2001
From: Michael Hunteman <michael@huntm.net>
Date: Wed, 21 Feb 2024 19:43:07 -0600
Subject: Update example guests.json with RTK query

---
 src/ThemeContextProvider.tsx | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

(limited to 'src/ThemeContextProvider.tsx')

diff --git a/src/ThemeContextProvider.tsx b/src/ThemeContextProvider.tsx
index 970f9d8..e1e928c 100644
--- a/src/ThemeContextProvider.tsx
+++ b/src/ThemeContextProvider.tsx
@@ -1,8 +1,8 @@
 import { ReactNode, createContext, useMemo, useState } from 'react';
-import { StyledEngineProvider, ThemeProvider, createTheme } from '@mui/material/styles';
+import { ThemeProvider, createTheme } from '@mui/material/styles';
 
 type ThemeContextType = {
-  switchColorMode: () => void;
+  toggleColorMode: () => void;
 };
 
 type ThemeProviderProps = {
@@ -10,13 +10,13 @@ type ThemeProviderProps = {
 };
 
 export const ThemeContext = createContext<ThemeContextType>({
-  switchColorMode: () => {}
+  toggleColorMode: () => {}
 });
 
 function ThemeContextProvider({ children }: ThemeProviderProps) {
   const [mode, setMode] = useState<'light' | 'dark'>('light');
 
-  const switchColorMode = () => {
+  const toggleColorMode = () => {
     setMode((prevMode) => (prevMode === 'light' ? 'dark' : 'light'));
   };
 
@@ -31,14 +31,12 @@ function ThemeContextProvider({ children }: ThemeProviderProps) {
   );
 
   return (
-    <StyledEngineProvider injectFirst>
-      <ThemeContext.Provider value={{ switchColorMode }}>
-        <ThemeProvider theme={theme}>
-          {children}
-        </ThemeProvider>
-      </ThemeContext.Provider>
-    </StyledEngineProvider>
+    <ThemeContext.Provider value={{ toggleColorMode }}>
+      <ThemeProvider theme={theme}>
+        {children}
+      </ThemeProvider>
+    </ThemeContext.Provider>
   );
-}
+};
 
 export default ThemeContextProvider;
-- 
cgit v1.2.3

