Skip to content
Submitted over 2 years ago

Responsive dashboard with React and Chakra-ui

react, chakra-ui
LVL 2
Dor Shani150
@dors001
A solution to the Time tracking dashboard challenge

Solution retrospective


Hey everybody! Thank you for reviewing my code and giving feedback. I've been cracking my head on the hook that i made in order to make it return daily/weekly/monthly values without explicitly stating with a if statements which timeframe i wanted, but after a few hours i chose the duplication of code way.

does anyone have an idea how i turn this: CardTimeFrames={{ current: c.timeframes.daily.current, previous: c.timeframes.daily.previous, }}

into this?

CardTimeFrames={{ current: c.timeframes.[// daily/weekly/monthly //].current, previous: c.timeframes.[// daily/weekly/monthly //].previous, }}

Thank you in advance!

Code
Loading...

Please log in to post a comment

Log in

Community feedback

No feedback yet. Be the first to give feedback on Dor Shani’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