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

Update home.html #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MAYANK12SHARMA
Copy link

@MAYANK12SHARMA MAYANK12SHARMA commented Oct 8, 2024

Description:
This PR addresses the issue where the "Dark Mode" button successfully toggled the theme, but the button text did not change accordingly. The text remained "Dark Mode" even after switching to dark mode, which could confuse users.

Issue:
Fixes #48

Problem:
When the user clicked on the "Dark Mode" button, the UI theme switched correctly, but the button label did not update. Instead, it continued to display "Dark Mode" even though dark mode was already active. The button text should have switched to "Light Mode" after enabling dark mode.

Fix:
I updated the logic behind the button so that the text now dynamically changes based on the current theme mode.
When dark mode is enabled, the button text changes to "Light Mode," and when light mode is active, the button text correctly displays "Dark Mode."

Steps to test the fix:
Click the "Dark Mode" button.
Verify that the UI theme switches to dark mode.
Check that the button text changes to "Light Mode" once dark mode is enabled.
Click the button again to switch back to light mode and confirm that the button text updates to "Dark Mode" accordingly.

Screenshots:
Before:
https://private-user-images.githubusercontent.com/145884197/373887362-1ce53de7-3fb4-498c-8c3f-74d569451ef7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg1Nzc5NzMsIm5iZiI6MTcyODU3NzY3MywicGF0aCI6Ii8xNDU4ODQxOTcvMzczODg3MzYyLTFjZTUzZGU3LTNmYjQtNDk4Yy04YzNmLTc0ZDU2OTQ1MWVmNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMDEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTAxMFQxNjI3NTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01MTYxNjAzY2I0NjUxOTI3NWJlYmUxMGM5NGY3Yjk1ZDNhMmI2ZjAwZmEzYjkzMTIwZjcwYWY0ZDQ3YzZhYWJlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.sRd2j2VsEYzK-VH8Srgp3gr4APySkFxKMDNtRL1rd1M

After:

https://private-user-images.githubusercontent.com/145884197/373887346-b4b4907a-671b-4ab1-9a8d-e07823af5300.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjg1Nzc5NzMsIm5iZiI6MTcyODU3NzY3MywicGF0aCI6Ii8xNDU4ODQxOTcvMzczODg3MzQ2LWI0YjQ5MDdhLTY3MWItNGFiMS05YThkLWUwNzgyM2FmNTMwMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMDEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTAxMFQxNjI3NTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zOGZjMDVmNTNjM2M5ZDM2OWRkZTc3YzVmNGMwNGVhZTM5MWNkYmRmMzZlNDBjYWFmY2Q2ZTk0ODAzMDRkZjQwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.HxO9amPVPOBT_QVnsgJyecAjM1EvAArk3exMFA--P80
image

@andoriyaprashant
Copy link
Owner

@MAYANK12SHARMA please add images in this Pull request discription
Thank you

@thestuti
Copy link
Collaborator

please resolve the conflict first.

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.

#Bug: Dark mode button label doesn't change when mode is toggled
3 participants