Request for Pomodoro clock review and help

hi all,

Can someone take a look at my pomodoro clock and suggest solution to pass the test.

Hi @nataliyah123. Welcome to the FCC forums.

I do not see your clickeable elements. This is better this elements be button than div. I think the button as element clickeable is a better perfomance with the onclick event.

Please, show us a better app presentation :see_no_evil:.

@ yoelvis I have not applied styling yet just for the sake of checking functionality . but as you have asked i will get back to you after applying css .the reason i didn’t use button was based on my last calculator experience where i used buttons and input for display and clickables, which created some problem especially the input tag. i had to re-coding most of the app and this was after applying css.

The onclick event supports the div element, but this element must be applied the style (display, width, height). Anyway this works.

Now, I think you must review the countdown logic, in the setInterval() window method. Your contdown do not decrementing by a value of 1 every 1000 ms. Your clock is more quick.

@nataliyah123 Fix the line #166

image

Thanks to @yoelvis and all others who have taken out time to view . i made the the changes (300 to 1000.it was something else i was trying to check and forgot to change back the time ).still it is not passing the test

@nataliyah123 Now, you can not pass the user stories due the element with id start_stop must be just one. I see a div container with that id and two elements to start and pause. The element with that id handles both start and pause functions.

thanks @yoelvis . but “i” tags are inside a wrapper div and the onclick event is attached to the wrapper div and not with the “i” tags(still i have checked your suggestion) . however i have managed to clear few more test by adding a settimeout to sped up the clock a lit bit , it is the test and asynchronous nature of setinterval that is causing the problems because test sped up timer .
stuck on two last tests :sob:

image

This is not the proper use of this.setState.

Why do not you link your element with id “timer-label” directly to the state?

<div id='timer-label'>{this.state.label}</div>

Another thing: do not allow the countdown reach negative values. Your code says:

(Line #142) if (starttime < 0)

This must replace by

if (starttime == 0) {
   this.setState({starttime: 'Break'})
   statetements...
}

thanks @yoelvis . i think they have made some changes to test so i reverted back to last few changes i have made and i manage to clear all test. finally

Congrats! :clap: :clap: :clap:

1 Like