baseweb icon indicating copy to clipboard operation
baseweb copied to clipboard

Button timer

Open lhbrennan opened this issue 1 year ago • 3 comments

Description

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

Scope

Minor: New Feature

lhbrennan avatar Sep 15 '22 23:09 lhbrennan

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 5c52d14b298a139f24122d2c3d800b737730f72f:

Sandbox Source
Basic usage Configuration

codesandbox-ci[bot] avatar Sep 15 '22 23:09 codesandbox-ci[bot]

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

cloudflare-pages[bot] avatar Sep 15 '22 23:09 cloudflare-pages[bot]

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: https://github.com/uber/baseweb/pull/5161

UberOpenSourceBot avatar Sep 15 '22 23:09 UberOpenSourceBot

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: https://github.com/uber/baseweb/pull/5161

UberOpenSourceBot avatar Sep 29 '22 17:09 UberOpenSourceBot

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?

lhbrennan avatar Sep 29 '22 20:09 lhbrennan

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

chasestarr avatar Sep 30 '22 21:09 chasestarr

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: https://github.com/uber/baseweb/pull/5161

UberOpenSourceBot avatar Oct 04 '22 22:10 UberOpenSourceBot

Visual changes were detected on this branch. Please review the following PR containing updated snapshots: https://github.com/uber/baseweb/pull/5190

UberOpenSourceBot avatar Oct 06 '22 00:10 UberOpenSourceBot