diff options
author | eug-vs <eug-vs@keemail.me> | 2020-03-21 16:11:31 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-03-21 16:11:31 +0300 |
commit | 0f6c4e7e4d44314707535e2d7e3aba7b638cd2dd (patch) | |
tree | 85d063c88d2a3c637f2fd1222f06d55594e683ea /src/pages/Timer/TimerButton.tsx | |
parent | 0267191d92814e753b966ce3bdfbd9b804b313d7 (diff) | |
download | chrono-cube-ui-0f6c4e7e4d44314707535e2d7e3aba7b638cd2dd.tar.gz |
fix: add more missing types :ok_hand:
Diffstat (limited to 'src/pages/Timer/TimerButton.tsx')
-rw-r--r-- | src/pages/Timer/TimerButton.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pages/Timer/TimerButton.tsx b/src/pages/Timer/TimerButton.tsx index 86bbf76..0a3bf38 100644 --- a/src/pages/Timer/TimerButton.tsx +++ b/src/pages/Timer/TimerButton.tsx @@ -37,14 +37,14 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => { if (timeDelta <= 0) setMode('over'); setTime(convertTimeToString(timeDelta)); }, 10); - return () => clearInterval(repeater); + return (): void => clearInterval(repeater); } if (mode === 'running') { const repeater = setInterval(() => { setTime(convertTimeToString(Date.now() - timestamp)); }, 10); - return () => clearInterval(repeater); + return (): void => clearInterval(repeater); } if (mode === 'over') { @@ -74,13 +74,13 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => { window.addEventListener('keyup', handleKeyUp); window.addEventListener('keypress', handleKeyPress); - return () => { + return (): void => { window.removeEventListener('keyup', handleKeyUp); window.removeEventListener('keypress', handleKeyPress); }; }); - const composeHelperText = () => { + const composeHelperText = (): string => { switch (mode) { case 'running': return 'Go fast!'; case 'countdown': return 'Release SPACE to begin'; @@ -89,7 +89,7 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => { } }; - const helperColor = () => { + const helperColor = (): 'primary' | 'secondary' | 'textSecondary' => { switch (mode) { case 'running': return 'primary'; case 'over': return 'secondary'; |