summaryrefslogtreecommitdiff
path: root/web/src/components/TimerIcon.tsx
diff options
context:
space:
mode:
authorAmir Zarrinkafsh <nightah@me.com>2021-01-02 21:58:24 +1100
committerGitHub <noreply@github.com>2021-01-02 21:58:24 +1100
commit689fd7cb954afd5eaeab49e122cdd2ee86bc6c82 (patch)
tree39ecf8710d9758edc2eb87882cadabe870ab9d1e /web/src/components/TimerIcon.tsx
parenta5ea31e482df16acda15b77b3a7db24a2a5b7be7 (diff)
[CI] Add linting option for frontend and enforce styling (#1565)
We now extend the default Eslint configuration and enforce styling with prettier for all of our frontend code.
Diffstat (limited to 'web/src/components/TimerIcon.tsx')
-rw-r--r--web/src/components/TimerIcon.tsx22
1 files changed, 14 insertions, 8 deletions
diff --git a/web/src/components/TimerIcon.tsx b/web/src/components/TimerIcon.tsx
index 9a185f005..48d3510e0 100644
--- a/web/src/components/TimerIcon.tsx
+++ b/web/src/components/TimerIcon.tsx
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from "react";
+
import PieChartIcon from "./PieChartIcon";
export interface Props {
@@ -16,21 +17,26 @@ const TimerIcon = function (props: Props) {
useEffect(() => {
// Get the current number of seconds to initialize timer.
- const initialValue = (new Date().getTime() / 1000) % props.period / props.period * radius;
+ const initialValue = (((new Date().getTime() / 1000) % props.period) / props.period) * radius;
setTimeProgress(initialValue);
const interval = setInterval(() => {
- const value = (new Date().getTime() / 1000) % props.period / props.period * radius;
+ const value = (((new Date().getTime() / 1000) % props.period) / props.period) * radius;
setTimeProgress(value);
}, 100);
return () => clearInterval(interval);
}, [props]);
return (
- <PieChartIcon width={props.width} height={props.height}
- progress={timeProgress} maxProgress={radius}
- backgroundColor={props.backgroundColor} color={props.color} />
- )
-}
+ <PieChartIcon
+ width={props.width}
+ height={props.height}
+ progress={timeProgress}
+ maxProgress={radius}
+ backgroundColor={props.backgroundColor}
+ color={props.color}
+ />
+ );
+};
-export default TimerIcon \ No newline at end of file
+export default TimerIcon;