Feedback required for Pomodoro Clock project

I have built a Pomodoro clock as per one of the projects mentioned in Front End Libraries Certification.

I have built the app using React. I am new to React and have used all functional components and hooks.

Link: Pomodoro

Can someone please review my code and provide a feedback about it ? Like ways to optimize, modularity improvement, etc.

Hey Abhi,

congrats on your project, great job so far! :clap:

My ideas:

  • all tests pass, awesome!

  • for React projects, I would use codesandbox: it will give you a more real-life environment, e.g. you can create different files for different components, you have a linter; this is especially cool when you have a local project: you put it on Github and can import it on codesandbox, no need to copy and paste or keep stuff in sync

  • I’d remove the magic numbers: the number 60 is 19 times in your js code, 25 3 times; without knowledge what a pomodoro timer is, this will increase the need for cognitive energy

  • I’d move helper functions like padTime, getMinutes and getSeconds into a folder utils or helpers, maybe other components (in a bigger project) would need these functions too; this is only personal preference, no need to overengineer your code

Overall great work,
looking forward to seeing your next steps.

Hey Michael,

Thanks a lot for taking time and reviewing the code!

Codesandbox is great, will try to incorporate the project in it.

For numbers 60 and 25, as they are repeated multiple times in the code, you meant to store it in a variables, right?