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

refactor: implement encapsulation for theme logic into structured functions πŸͺ„βœ¨ #708

Closed
wants to merge 2 commits into from

Conversation

0xabdulkhaliq
Copy link
Contributor

Related Issue

Close #693

Proposed Changes

  1. Encapsulate the dark mode logic into functions: The existing code will be refactored to encapsulate the theme setting logic into functions. This will improve the readability and make the code easier to understand.

  2. Use constants for theme values: Instead of using hard-coded theme strings, we will introduce constants for the theme values to avoid repetition and enhance code clarity.

  3. Optimize code for setting and toggling themes: The functions will be designed to handle setting the appropriate class and updating UI elements based on the selected theme. The toggleTheme() function will be responsible for toggling between light and dark mode.

  4. Improve theme initialization: The theme initialization process will be streamlined to handle user preferences or default to the dark theme if no preference is found.

Checklist

  • βœ… My code follows the code style of this project.
  • πŸ“ My change requires a change to the documentation.
  • πŸŽ€ I have updated the documentation accordingly.
  • 🌟 ed the repo
  • Refactor (Enhancing the existing codebase)

@netlify
Copy link

netlify bot commented Aug 8, 2023

βœ… Deploy Preview for codesetgo ready!

Name Link
πŸ”¨ Latest commit fdcebd4
πŸ” Latest deploy log https://app.netlify.com/sites/codesetgo/deploys/64d250f00be0a20008386c6f
😎 Deploy Preview https://deploy-preview-708--codesetgo.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@0xabdulkhaliq
Copy link
Contributor Author

Your review is appreciated @agamjotsingh18 πŸ‘πŸ»

@0xabdulkhaliq 0xabdulkhaliq closed this by deleting the head repository Aug 12, 2023
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.

refactor: encapsulate theme setting logic into functions πŸͺ„βœ¨
1 participant