simple calculator for basic operations

Solution retrospective
The most I proud of are: Handling User Input with Regex and Format Number: the function handleInput is well-structured. It uses regex to ensure proper handling of user input, preventing consecutive operators and duplicate decimal points. This is a smart way to handle edge cases without overcomplicating things.
The formatNumber function adds a nice touch to the UI by formatting the numbers with commas, making large numbers more readable.
Dynamic Theme Switching: the dynamic theme switching feature is well-implemented with the handleThemeToggle and handleThemeNum functions. This feature adds an interactive element to the app, which is a great UX improvement.
Keyboard Support: the use of useEffect and the addition of a key event listener to handle keyboard presses (keydown) is a nice touch. This makes the app more user-friendly, as users can interact with it using the keyboard in addition to the buttons.
What challenges did you encounter, and how did you overcome them?Managing Multiple Themes Dynamically: Challenge: Implementing dynamic theme switching is not as simple as it sounds, especially when you need to ensure that the correct styles apply across all elements. Managing the themes and ensuring the correct CSS classes are applied when toggling between themes can be tricky.
Resolution: The solution provided here with the handleThemeToggle and handleThemeNum functions works fine, but ensuring that all the components update appropriately when switching themes without causing rendering issues could be a potential challenge in more complex apps.
What specific areas of your project would you like help with?any feedback or suggestion are welcomed
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Bashirmoh25's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord