Skip to content
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

Improved Theme Toggle Button Functionality #36

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

pujaak
Copy link
Contributor

@pujaak pujaak commented Jan 8, 2025

Description:

This pull request addresses the issue with the theme toggle button on the website. The previous behavior involved a dropdown that required an additional action to change the theme. I have improved the functionality so that the toggle button directly switches between light and dark themes without the need for a dropdown.

Fixes #34

Changes Made:

  1. Replaced the dropdown with a direct theme change upon toggle button click.
  2. Ensured the light theme toggle button displays a visible icon (sun) even when not hovered over.

Screenshots

image
image

Testing Done:

  1. Tested theme toggle functionality in both light and dark modes.
  2. Ensured the toggle button now directly changes themes without dropdown.
  3. Verified the visibility of the icon in both themes.

Copy link

vercel bot commented Jan 8, 2025

@pujaak is attempting to deploy a commit to the Yash Kumar Saini's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Jan 8, 2025

Welcome, new contributor!

   Please make sure you've read our [Contributing Guide](README.md) and we look forward to reviewing your Pull request shortly ✨

Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
leetcode-journal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 6:12pm

@yashksaini-coder yashksaini-coder added good first issue Good for newcomers SWOC officially part of SWOC season 5 Beginner SWOC Level 1 issue labels Jan 8, 2025
Copy link
Owner

@yashksaini-coder yashksaini-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pujaak Thank you for your contributions

@yashksaini-coder yashksaini-coder merged commit ca1e6a4 into yashksaini-coder:main Jan 8, 2025
4 checks passed
@yashksaini-coder yashksaini-coder added the Points Assigned The points have been assigned on OS Lead label Jan 8, 2025
@pujaak
Copy link
Contributor Author

pujaak commented Jan 9, 2025

@yashksaini-coder Hey, I think I need to make more changes to the code I have submitted, as I can see that both the moon and sun icons appear and overlap with each other when the website is visited for the first time or refreshed.
I am thinking of adding a check to ensure the components render only after the theme is loaded.

@yashksaini-coder
Copy link
Owner

@yashksaini-coder Hey, I think I need to make more changes to the code I have submitted, as I can see that both the moon and sun icons appear and overlap with each other when the website is visited for the first time or refreshed. I am thinking of adding a check to ensure the components render only after the theme is loaded.

Okay Im raising another issue for that @pujaak

@pujaak
Copy link
Contributor Author

pujaak commented Jan 9, 2025

@yashksaini-coder I have added the check, so the icons do not overlap at the start, though they appear after the theme is rendered, I guess one or half second later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beginner SWOC Level 1 issue good first issue Good for newcomers Points Assigned The points have been assigned on OS Lead SWOC officially part of SWOC season 5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Light Theme Toggle Button Icon Not Visible
2 participants