diff --git a/space_flow/public/index.html b/space_flow/public/index.html index 52741e97f..e9ecbe8ec 100644 --- a/space_flow/public/index.html +++ b/space_flow/public/index.html @@ -6,7 +6,7 @@ Document - +
diff --git a/space_flow/src/App.tsx b/space_flow/src/App.tsx index 3cfb3a582..cca4e3df1 100644 --- a/space_flow/src/App.tsx +++ b/space_flow/src/App.tsx @@ -96,7 +96,7 @@ export default function App() { return ( //need parent component with width and height -
+
diff --git a/space_flow/src/contexts/darkContext.tsx b/space_flow/src/contexts/darkContext.tsx index f64e0aa6e..fcdb73cc4 100644 --- a/space_flow/src/contexts/darkContext.tsx +++ b/space_flow/src/contexts/darkContext.tsx @@ -1,4 +1,4 @@ -import { createContext, useState } from "react"; +import { createContext, useEffect, useState } from "react"; type darkContextType = { dark: {}; @@ -14,6 +14,13 @@ export const darkContext = createContext(initialValue); export function DarkProvider({ children }) { const [dark, setDark] = useState(false); + useEffect(()=>{ + if(dark){ + document.getElementById("body").classList.add("dark"); + } else { + document.getElementById("body").classList.remove("dark"); + } + }, [dark]) return ( -
+
@@ -46,11 +46,11 @@ export default function TextAreaModal({value, setValue}){ leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - +
-
+
-
+
-
-