diff --git a/src/features/misc/sections/Language.jsx b/src/features/misc/sections/Language.jsx
index abc42ee4..1789773a 100644
--- a/src/features/misc/sections/Language.jsx
+++ b/src/features/misc/sections/Language.jsx
@@ -74,10 +74,6 @@ class LanguageOptions extends PureComponent {
{variables.getMessage('modals.main.settings.sections.language.title')}
{this.state.author}
{this.state.authorOccupation !== 'Unknown' && (
diff --git a/src/features/time/Clock.jsx b/src/features/time/Clock.jsx
index cb686d43..3e120e66 100644
--- a/src/features/time/Clock.jsx
+++ b/src/features/time/Clock.jsx
@@ -1,26 +1,24 @@
-import { PureComponent, Suspense, lazy } from 'react';
+import { PureComponent } from 'react';
import { convertTimezone } from 'utils/date';
+import { AnalogClock } from './components/AnalogClock';
+import { VerticalClock } from './components/VerticalClock';
import EventBus from 'utils/eventbus';
import './clock.scss';
-
-const Analog = lazy(() => import('react-clock'));
-
export default class Clock extends PureComponent {
constructor() {
super();
this.timer = undefined;
this.state = {
+ timeType: localStorage.getItem('timeType'),
time: '',
finalHour: '',
finalMinute: '',
finalSeconds: '',
ampm: '',
nowGlobal: new Date(),
- minuteColour: localStorage.getItem('minuteColour'),
- hourColour: localStorage.getItem('hourColour'),
};
}
@@ -153,41 +151,17 @@ export default class Clock extends PureComponent {
}
render() {
- const enabled = (setting) => {
- return localStorage.getItem(setting) === 'true';
- };
-
if (localStorage.getItem('timeType') === 'analogue') {
- return (
-
>}>
-
-
- );
+ return
;
}
if (localStorage.getItem('timeType') === 'verticalClock') {
return (
-
- {' '}
-
- {this.state.finalHour}
-
{' '}
-
- {this.state.finalMinute}
-
{' '}
- {this.state.finalSeconds}
{' '}
-
+
);
}
diff --git a/src/features/time/components/AnalogClock.jsx b/src/features/time/components/AnalogClock.jsx
new file mode 100644
index 00000000..b3835fb1
--- /dev/null
+++ b/src/features/time/components/AnalogClock.jsx
@@ -0,0 +1,26 @@
+import { Suspense, lazy } from 'react';
+const Analog = lazy(() => import('react-clock'));
+
+function AnalogClock({ time }) {
+ const enabled = (setting) => {
+ return localStorage.getItem(setting) === 'true';
+ };
+ return (
+
>}>
+
+
+ );
+}
+
+export { AnalogClock as default, AnalogClock };
diff --git a/src/features/time/components/VerticalClock.jsx b/src/features/time/components/VerticalClock.jsx
new file mode 100644
index 00000000..c67647b7
--- /dev/null
+++ b/src/features/time/components/VerticalClock.jsx
@@ -0,0 +1,18 @@
+function VerticalClock({ finalHour, finalMinute, finalSeconds }) {
+ const hourColour = localStorage.getItem('hourColour') || '#fff';
+ const minuteColour = localStorage.getItem('minuteColour') || '#ƒff';
+
+ return (
+
+
+ {finalHour}
+
+
+ {finalMinute}
+
+ {finalSeconds}
+
+ );
+}
+
+export { VerticalClock as default, VerticalClock };