Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEE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