From a087494f6809a7a8ea8e6c27a105d8c8f0f3839e Mon Sep 17 00:00:00 2001
From: Tom van der Lee <tom@vanderlee.io>
Date: Wed, 4 Sep 2024 10:27:24 +0200
Subject: Updated the libraries

---
 src/contexts/DarkMode.tsx | 41 -----------------------------------------
 1 file changed, 41 deletions(-)
 delete mode 100644 src/contexts/DarkMode.tsx

(limited to 'src/contexts/DarkMode.tsx')

diff --git a/src/contexts/DarkMode.tsx b/src/contexts/DarkMode.tsx
deleted file mode 100644
index fd536b2..0000000
--- a/src/contexts/DarkMode.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import * as React from "react";
-import {
-  Context,
-  createContext,
-  PropsWithChildren,
-  useEffect,
-  useMemo,
-  useState,
-} from "react";
-import { ThemeConfig } from "bootstrap-darkmode";
-
-interface DarkModeApi {
-  darkMode: boolean;
-  toggle: () => void;
-}
-
-export const DarkModeContext = createContext<Partial<DarkModeApi>>(
-  {}
-) as Context<DarkModeApi>;
-
-export default function DarkModeProvider({ children }: PropsWithChildren<any>) {
-  const themeConfig = useMemo(() => new ThemeConfig(), []);
-  const [darkMode, setDarkMode] = useState(
-    () => themeConfig.getTheme() === "dark"
-  );
-
-  useEffect(() => {
-    themeConfig.setTheme(darkMode ? "dark" : "light");
-  }, [darkMode]);
-
-  return (
-    <DarkModeContext.Provider
-      value={{
-        darkMode,
-        toggle: () => setDarkMode((dm) => !dm),
-      }}
-    >
-      {children}
-    </DarkModeContext.Provider>
-  );
-}
-- 
cgit v1.2.3

