@@ -37,6 +37,7 @@ function MyTimer({ expiryTimestamp }) {
3737 minutes ,
3838 hours ,
3939 days ,
40+ isRunning ,
4041 start ,
4142 pause ,
4243 resume ,
@@ -51,6 +52,7 @@ function MyTimer({ expiryTimestamp }) {
5152 < div style= {{fontSize: ' 100px' }}>
5253 < span> {days}< / span> : < span> {hours}< / span> : < span> {minutes}< / span> : < span> {seconds}< / span>
5354 < / div>
55+ < p> {isRunning ? ' Running' : ' Not running' }< / p>
5456 < button onClick= {start}> Start< / button>
5557 < button onClick= {pause}> Pause< / button>
5658 < button onClick= {resume}> Resume< / button>
@@ -90,6 +92,7 @@ export default function App() {
9092| minutes | number | minutes value |
9193| hours | number | hours value |
9294| days | number | days value |
95+ | isRunning | boolean | flag to indicate if timer is running or not |
9396| pause | function | function to be called to pause timer |
9497| start | function | function if called after pause the timer will continue based on original expiryTimestamp |
9598| resume | function | function if called after pause the timer will continue countdown from last paused state |
@@ -112,6 +115,7 @@ function MyStopwatch() {
112115 minutes ,
113116 hours ,
114117 days ,
118+ isRunning ,
115119 start ,
116120 pause ,
117121 reset ,
@@ -125,6 +129,7 @@ function MyStopwatch() {
125129 < div style= {{fontSize: ' 100px' }}>
126130 < span> {days}< / span> : < span> {hours}< / span> : < span> {minutes}< / span> : < span> {seconds}< / span>
127131 < / div>
132+ < p> {isRunning ? ' Running' : ' Not running' }< / p>
128133 < button onClick= {start}> Start< / button>
129134 < button onClick= {pause}> Pause< / button>
130135 < button onClick= {reset}> Reset< / button>
@@ -155,6 +160,7 @@ export default function App() {
155160| minutes | number | minutes value |
156161| hours | number | hours value |
157162| days | number | days value |
163+ | isRunning | boolean | flag to indicate if stopwatch is running or not |
158164| start | function | function to be called to start/resume stopwatch |
159165| pause | function | function to be called to pause stopwatch |
160166| reset | function | function to be called to reset stopwatch to 0:0:0:0 |
0 commit comments