diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Good_First_Issue_Web_App.iml b/.idea/Good_First_Issue_Web_App.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/Good_First_Issue_Web_App.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..4dfb542 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1d3ce46 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b29f58e --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..f03a665 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Good_First_Issue_Web_App b/Good_First_Issue_Web_App new file mode 160000 index 0000000..7e25890 --- /dev/null +++ b/Good_First_Issue_Web_App @@ -0,0 +1 @@ +Subproject commit 7e25890e80c511450ba39769acbff21be4a33293 diff --git a/frontend/src/App.css b/frontend/src/App.css index 74b5e05..8ca269b 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -12,6 +12,34 @@ animation: App-logo-spin infinite 20s linear; } } +/* Light Mode (default) */ +body { + background-color: #ffffff; + color: #000000; + transition: background-color 0.3s, color 0.3s; +} + +/* Dark Mode */ +body.dark-mode { + background-color: #121212; + color: #ffffff; +} + +/* Toggle Button */ +.dark-toggle-btn { + background: transparent; + color: inherit; + border: 1px solid #888; + padding: 6px 12px; + border-radius: 6px; + cursor: pointer; + margin-left: 15px; +} + +.dark-toggle-btn:hover { + background: rgba(255, 255, 255, 0.1); +} + .App-header { background-color: #282c34; diff --git a/frontend/src/App.js b/frontend/src/App.js index 4f2ede4..0e476ea 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,6 +1,10 @@ import "./App.css"; import {Hero, About, Repositories, Form, Layout} from './pages' import { Route, RouterProvider, createBrowserRouter, createRoutesFromElements } from 'react-router-dom' +import IncidentResponse from "./pages/IncidentResponse"; + +// inside or equivalent +} /> const router = createBrowserRouter( createRoutesFromElements( diff --git a/frontend/src/pages/Layout.js b/frontend/src/pages/Layout.js index 963149b..ad0ac00 100644 --- a/frontend/src/pages/Layout.js +++ b/frontend/src/pages/Layout.js @@ -5,6 +5,53 @@ import {Outlet} from 'react-router-dom' function Layout() { return ( <> + import React, { useState, useEffect } from "react"; +import { Outlet } from "react-router-dom"; +import "./Layout.css"; + +export default function Layout() { + const [darkMode, setDarkMode] = useState(false); + + // Load theme from localStorage on mount + useEffect(() => { + const savedTheme = localStorage.getItem("theme"); + if (savedTheme === "dark") { + setDarkMode(true); + document.body.classList.add("dark-mode"); + } + }, []); + + const toggleTheme = () => { + if (darkMode) { + document.body.classList.remove("dark-mode"); + localStorage.setItem("theme", "light"); + setDarkMode(false); + } else { + document.body.classList.add("dark-mode"); + localStorage.setItem("theme", "dark"); + setDarkMode(true); + } + }; + + return ( +
+
+

Good First Issue Web App

+ +
+ +
+ +
+
+ ); +} +