New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Timer component #264

Merged
merged 7 commits into from Dec 19, 2018

Conversation

Projects
None yet
2 participants
@josx
Copy link
Contributor

josx commented Dec 5, 2018

After some chat with @bpierre on #263, I followed his advice on add a new component called Timer that support both start or end as prop (stopwatch or countdown features). At the same I have kept backwards compat with current Countdown component (that just use Timer internally).

josx added some commits Dec 5, 2018

Add Timer component
Signed-off-by: José Luis Di Biase <josx@interorganic.com.ar>
Timer and Countdown: Better readme info
Signed-off-by: José Luis Di Biase <josx@interorganic.com.ar>

@sohkai sohkai requested a review from bpierre Dec 7, 2018

@josx

This comment has been minimized.

Copy link
Contributor

josx commented Dec 11, 2018

I dont know why travis show as pending, and when you enter and view the details says passed in green.

@bpierre
Copy link
Member

bpierre left a comment

Looking good, thanks for contributing! 🙌

I just left a comment, let me know what you think 🙂

Show resolved Hide resolved src/components/Timer/Timer.js Outdated
@bpierre

This comment has been minimized.

Copy link
Member

bpierre commented Dec 12, 2018

@josx I added commits to sync with master + add a devbox/ demo 👍

Timer: Adding format
Signed-off-by: José Luis Di Biase <josx@interorganic.com.ar>
@josx

This comment has been minimized.

Copy link
Contributor

josx commented Dec 14, 2018

@bpierre your feature request about format it is done and working ;)

bpierre added some commits Dec 19, 2018

Small tweaks
Add two formats: "m" and "s".

Add the showEmpty prop: when set to `true`, the units on the left side
of the timer will be displayed, even if they are equal to zero.

Adjust the time depending on the format, so that the indicated time is
always correct. For example, “1D 3H 10M” becomes “27H 10M” if days are
not displayed.
@bpierre

This comment has been minimized.

Copy link
Member

bpierre commented Dec 19, 2018

@josx Thank you, super clean! 💫

I added a few things:

  • Add two formats: "m" and "s".
  • Add a showEmpty prop: when set to false (default), the units on the left side of the timer will be automatically hidden if they are equal to zero.
  • Adjust the time depending on the format, so that the indicated time is always correct. For example, “1D 3H 10M” becomes “27H 10M” when days are not displayed.

@bpierre bpierre merged commit ed2facc into aragon:master Dec 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment