Pricing component with toggle

Please log in to post a comment
Log in with GitHubCommunity feedback
- @MarziaJalili
Pixel perfect! 🔥
🌟 A tiny tweak on DRY cod?
✅ Instead of setting CSS class names to change the values, you could use conditional rendering, man.
✅ You could simply use a ternary to a achieve that as follows:
<h2 className="price"> <span>$</span>{btnState ? "19.99" : "199.99"} </h2>
The same can be applied to the two other ones as well.
The web's pixel perfect overall — keep up the momentum! 💪😎🏅
Marked as helpful
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