Timetracking Dashboard - JS + SASS + JSON

Solution retrospective
Anything helps!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @MarziaJalili
The web's on fire! 🔥
✨ A quick win for better UI?
✅ If the value of the hours is
1
, it might not be really good to display1hrs
, dear.✅ To fix this you can simply put a ternary to render either 1hr or [0, or numbers larger than 1]hrs as follows:
const hourStr = num === 1 ? “hr” : “hrs”;
✅ Then, life is easier using a template string you can render the text:
<p class="card__current">${timeframe.current}${hourStr}</p>
Other than that, you know your work!
🔥🔥🔥
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