-
-
Notifications
You must be signed in to change notification settings - Fork 48
FIXED ISSUE #84 : Added Global Theme Toggle (Dark/Light Mode Support) #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@Stonebanks-js is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@DhanushNehru I created this pull request before you assigned me the issue number #84, kindly assign me and add hacktoberfest 2025 labels before chekiong this PR Also If any changes have to made, I am open to resolve the conflicts. Thank you |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds global theme toggling (dark/light) with persistence across sessions by introducing a ThemeProvider and an HTML shell for Tailwind darkMode: 'class'.
- Wraps the app with ThemeProvider to enable system/default theming and persistence.
- Adds an index.html shell with Tailwind-compatible classes and Vite entry script.
- Removes CurrentUserProvider wrapper, which likely breaks user context availability.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/App.tsx | Introduces ThemeProvider and restructures provider tree; removes CurrentUserProvider wrapper. |
| public/index.html | Adds Vite HTML shell with dark mode class and root mount; currently placed under public. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <BrowserRouter> | ||
| <Routes> | ||
| <Route path="/" element={<Index />} /> | ||
| {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} | ||
| <Route path="*" element={<NotFound />} /> | ||
| </Routes> | ||
| </BrowserRouter> |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the CurrentUserProvider wrapper disconnects any consumers of CurrentUserContext and will break features that rely on current user state. Please reintroduce the provider around the router (or the entire app) to restore context.
| <BrowserRouter> | |
| <Routes> | |
| <Route path="/" element={<Index />} /> | |
| {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} | |
| <Route path="*" element={<NotFound />} /> | |
| </Routes> | |
| </BrowserRouter> | |
| <CurrentUserProvider> | |
| <BrowserRouter> | |
| <Routes> | |
| <Route path="/" element={<Index />} /> | |
| {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} | |
| <Route path="*" element={<NotFound />} /> | |
| </Routes> | |
| </BrowserRouter> | |
| </CurrentUserProvider> |
| </head> | ||
| <body class="bg-background text-foreground min-h-screen"> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vite expects index.html at the project root to act as the HTML entry; placing it under public means Vite won't process it, and the app won't boot via this template. Move this file to the project root (./index.html) and remove/avoid duplicates under public.
| @@ -0,0 +1,14 @@ | |||
| <!doctype html> | |||
| <html lang="en" class="dark"> | |||
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding class="dark" forces dark mode and conflicts with defaultTheme="system" (and can cause a visible flash before ThemeProvider runs). Remove the hardcoded class and let ThemeProvider (or an inline no-FOUC script) manage the initial theme class on the root element.
| <html lang="en" class="dark"> | |
| <html lang="en"> |
| import { ThemeProvider } from "@/components/theme/provider"; | ||
| import Index from "./pages/Index"; | ||
| import NotFound from "./pages/NotFound"; | ||
| import { CurrentUserProvider } from "@/context/CurrentUserContext"; |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CurrentUserProvider is imported but no longer used in this file after removing the wrapper, which may trigger lint errors and increases noise. Either re-add the provider (recommended) or remove this unused import.
| import { CurrentUserProvider } from "@/context/CurrentUserContext"; |

🧩 Summary
FIXES #84
This pull request introduces a global theme system with persistent dark/light mode functionality.
It enhances user experience by allowing seamless theme switching across the app and retaining preference between sessions.
🛠️ Changes Made
✅ Verification Steps