mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-15 15:27:59 +00:00
icon
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import { useStopwatch } from 'react-timer-hook';
|
import { useStopwatch } from 'react-timer-hook';
|
||||||
import { TimerStyle, TimerWrapper } from './Timer';
|
import { TimerStyle, TimerWrapper } from './Timer';
|
||||||
import { Time } from './Time';
|
import { Time } from './Time';
|
||||||
|
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||||
|
import PauseIcon from '@mui/icons-material/Pause';
|
||||||
|
|
||||||
export const NegativeStopWatch = ({
|
export const NegativeStopWatch = ({
|
||||||
autoStart = false,
|
autoStart = false,
|
||||||
@@ -18,9 +20,16 @@ export const NegativeStopWatch = ({
|
|||||||
{'-'}
|
{'-'}
|
||||||
<Time time={{ hours, minutes, seconds }} />
|
<Time time={{ hours, minutes, seconds }} />
|
||||||
<div>
|
<div>
|
||||||
{/* Only show Start if the timer is not running */}
|
{!isRunning && (
|
||||||
{!isRunning && <button onClick={start}>Start</button>}
|
<button onClick={start}>
|
||||||
{isRunning && <button onClick={pause}>Pause</button>}
|
<PlayArrowIcon />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{isRunning && (
|
||||||
|
<button onClick={pause}>
|
||||||
|
<PauseIcon />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</TimerStyle>
|
</TimerStyle>
|
||||||
</TimerWrapper>
|
</TimerWrapper>
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export const Timer = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{/* Only show Start if the timer is not running */}
|
|
||||||
{!isRunning && (
|
{!isRunning && (
|
||||||
<button onClick={handleStart}>
|
<button onClick={handleStart}>
|
||||||
<PlayArrowIcon />
|
<PlayArrowIcon />
|
||||||
|
|||||||
Reference in New Issue
Block a user