Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
Getting feedback and learning from professionals good code practice and approaches always is good to have.
I learned making a toggle switch using two radio buttons for chosen Plan.
I'm happy with the end result and looking into different ways in approaching it can make the concept better understood :)
What challenges did you encounter, and how did you overcome them?Updating discount price
- I worked with useEffect hook to keep track of discount Boolean state but calculating the discount kept decreasing the price till zero. To fix it I declared an object literal containing each pageview with price and then using page state as index to loop through each data.
Toggle interaction
- I got the HTML structure and toggle style but I needed to make the span respond to radio clicks. I used JS
.click
method with onClick callback on span and declaredradioId
to switch based on chosen plan state.
I think I got all of interactions alright, I could ask on the toggle implementation and if there is any improvement I could make. Any feedback overall is appreciated :)
Community feedback
Please log in to post a comment
Log in with GitHubJoin 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