Skip to content

Comments

added theme toggle button correctly#230

Open
kalyaniugale wants to merge 260 commits intoSurajSG23:mainfrom
kalyaniugale:theme-toggle
Open

added theme toggle button correctly#230
kalyaniugale wants to merge 260 commits intoSurajSG23:mainfrom
kalyaniugale:theme-toggle

Conversation

@kalyaniugale
Copy link

Which issue does this PR close?


Rationale for this change

The theme toggle button in the app wasn’t functioning — clicking it didn’t actually switch between light and dark mode or update the UI.
This change introduces a proper dark-mode context and persistent state management so that the theme toggle works reliably across the entire app.


What changes are included in this PR?

  • Added a new DarkModeContext using React Context API.
  • Implemented theme persistence with localStorage and system preference fallback.
  • Applied the .dark class to <html> for global styling.
  • Replaced the old toggle logic with a reusable ThemeToggle component.
  • Updated Header.tsx to use the new toggle and context.
  • Verified correct theme switching and persistence across page reloads and routes.

Are these changes tested?

✅ Manually tested on local dev build:

  • Theme switches instantly on toggle click.
  • Selected mode persists after refresh.
  • Works across all routes and components.
  • No console or runtime errors observed.

Are there any user-facing changes?

✅ Yes — users can now successfully switch between light and dark themes.
The preference is remembered for future sessions, improving overall UX.

before :

(no toggle button)
image

after changes :

image image

SurajSG23 and others added 30 commits April 2, 2025 21:34
…nd dotenv, update index.html favicon, and add Firebase configuration
…ctionality; add useDetectTabSwitch hook to prevent tab switching during tests; update geminiPrompt format for consistency.
…erID prop; enhance Header with icons and improve Profile to fetch user rank.
…ate test model to include topic field and enhance routing for uploads.
…URI; update CORS settings to allow all origins.
…MongoDB URI; update CORS settings to allow all origins."

This reverts commit bcb7402.
…ges in HomePage, ScoreBoard, and PrevTests components; add file upload functionality in Profile component.
abhishekkalme and others added 28 commits September 9, 2025 19:49
…ractice components

- Integrated dark mode context in HtmlPractice, JavaPractice, JavaScriptPractice, and PythonPractice components.
- Updated styles for backgrounds, buttons, inputs, and text to adapt to dark mode.
- Improved accessibility and visual consistency by applying transition effects for color changes.
- Refactored conditional rendering of class names for better readability and maintainability.
…roved readability and dark mode support; optimize speech recognition handling and feedback generation logic.
…and TechnicalQuestionsPage components

- Added useDarkMode context to manage dark mode state.
- Updated styles in QuestionOfTheDay component to reflect dark mode.
- Refactored QuizPage to adjust colors and styles based on dark mode.
- Enhanced TechnicalQuestionsPage with dark mode styles for buttons and cards.
- Improved accessibility and user experience with responsive design adjustments.
…improvements

- Updated Header component to support dark mode styling for profile dropdown and icons.
- Improved loading screens and confirmation popups in HomePage with dark mode compatibility.
- Refactored company listing sections in HomePage for better readability and maintainability.
- Added dynamic class names for background and text colors based on dark mode state.
- Streamlined search functionality and UI elements for a more cohesive user experience.
…port and UI consistency

- Updated Profile component to integrate dark mode context and enhance loading states.
- Refactored modal styles in Profile for better dark mode compatibility.
- Improved user feedback during loading in ScoreBoard with dark mode adjustments.
- Enhanced leaderboard table styling in ScoreBoard for dark mode.
- Cleaned up unused imports and optimized state management in both components.
Added practice timer functionality across multiple components
…ent timer functionality, and improve UI/UX elements
feat: Implement dark+light mode support across the website
- Fixed navbar dropdown so it overlays content instead of pushing it down
- Updated positioning to use absolute overlay for consistent behavior
- Ensured proper z-index and backdrop styles for smooth UI
]
[fix(navbar): resolve overlay issue with mobile dropdown
Create pull request template for contributions
Added Workflow for autocomment on issues
Fix: added smooth scrolling for navbar links
Fixes homepage main title, text and cursor responsiveness
@vercel
Copy link

vercel bot commented Oct 19, 2025

Someone is attempting to deploy a commit to the surajsg23's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

theme toggle button does not change the theme (light/dark)