Skip to content

Button timer#5160

Merged
lhbrennan merged 30 commits intomasterfrom
button-timer
Oct 6, 2022
Merged

Button timer#5160
lhbrennan merged 30 commits intomasterfrom
button-timer

Conversation

@lhbrennan
Copy link
Contributor

Description

Build new Button Timed component: https://zeroheight.com/6d2425e9f/p/81070d-button-timed/b/284ec6

Scope

Minor: New Feature

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 15, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5c52d14:

Sandbox Source
Basic usage Configuration

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 15, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5c52d14
Status: ✅  Deploy successful!
Preview URL: https://fccec21d.baseweb.pages.dev
Branch Preview URL: https://button-timer.baseweb.pages.dev

View logs

@UberOpenSourceBot
Copy link
Contributor

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: #5161

Copy link
Collaborator

@chasestarr chasestarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visuals look good to me. I'm most interested in how a developer should be using this component. Currently it seems to be set up where when loaded to the page it will begin counting down from the set time and firing an event when finished. I'd like to see some way to stop/start the timer from outside the component.

An alternative api could be something similar to progress-bar where the application controls the progress through the timer and visuals are a pure function of props. Would that be too burdensome?

@UberOpenSourceBot
Copy link
Contributor

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: #5161

@lhbrennan
Copy link
Contributor Author

lhbrennan commented Sep 29, 2022

An alternative api could be something similar to progress-bar where the application controls the progress through the timer and visuals are a pure function of props. Would that be too burdensome?

Yea that would be more flexible. In terms of the API, I think we'd want something like timeRemaining (or maybe currentTime), as well as something like totalTime (or initialTime, or targetTime). Thoughts on naming those props? Should we use "seconds" instead of "time" to be more explicit?

@chasestarr
Copy link
Collaborator

Yea that would be more flexible. In terms of the API, I think we'd want something like timeRemaining (or maybe currentTime), as well as something like totalTime (or initialTime, or targetTime). Thoughts on naming those props? Should we use "seconds" instead of "time" to be more explicit?

Accepting a float between 0-1 is probably the 'cleanest' api, but maybe consider aligning with the existing progress-bar pattern. I guess this does not support rendering the time-remaining. Number of seconds remaining seems appropriate

@UberOpenSourceBot
Copy link
Contributor

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: #5161

Co-authored-by: UberOpenSourceBot <UberOpenSourceBot@users.noreply.github.com>
@lhbrennan lhbrennan marked this pull request as ready for review October 4, 2022 23:10
@lhbrennan lhbrennan requested a review from tajo as a code owner October 4, 2022 23:10
@lhbrennan lhbrennan force-pushed the button-timer branch 4 times, most recently from ee12d4c to fc0a815 Compare October 5, 2022 20:08
@lhbrennan lhbrennan force-pushed the button-timer branch 2 times, most recently from 20917f5 to c556204 Compare October 5, 2022 21:41
Copy link
Collaborator

@chasestarr chasestarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after some more integration tests

@UberOpenSourceBot
Copy link
Contributor

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: #5190

UberOpenSourceBot and others added 2 commits October 5, 2022 17:26
Co-authored-by: UberOpenSourceBot <UberOpenSourceBot@users.noreply.github.com>
@lhbrennan lhbrennan merged commit 71655c0 into master Oct 6, 2022
@lhbrennan lhbrennan deleted the button-timer branch October 6, 2022 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants