From b795ceb33d341f1417d3b3636748ca1d2660225c Mon Sep 17 00:00:00 2001 From: David Ralph Date: Wed, 28 Apr 2021 15:06:15 +0100 Subject: [PATCH] feat: hot reload for clock and greeting --- .../main/settings/sections/Greeting.jsx | 13 +++++------- .../modals/main/settings/sections/Time.jsx | 20 +++++++++---------- src/components/widgets/greeting/Greeting.jsx | 3 +++ src/components/widgets/time/Clock.jsx | 3 +++ 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index 2f46abca..bd7a588f 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -22,9 +22,6 @@ export default class GreetingSettings extends React.PureComponent { this.setState({ birthday: data }); - - document.querySelector('.reminder-info').style.display = 'block'; - localStorage.setItem('showReminder', true); } render() { @@ -34,13 +31,13 @@ export default class GreetingSettings extends React.PureComponent { <>

{greeting.title}

- - - + + +

{greeting.birthday}

- - + +

{greeting.birthday_date}

diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index ac36b522..8b828a88 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -34,21 +34,21 @@ export default class TimeSettings extends React.PureComponent { const digitalSettings = ( <>

{time.digital.title}

- +
- - + + ); const analogSettings = ( <>

{time.analogue.title}

- - - - - + + + + + ); @@ -94,8 +94,8 @@ export default class TimeSettings extends React.PureComponent { return ( <>

{time.title}

- - this.setState({ timeType: value })} category='clock' element='.other'> + + this.setState({ timeType: value })} category='clock' element='.clock-container'> diff --git a/src/components/widgets/greeting/Greeting.jsx b/src/components/widgets/greeting/Greeting.jsx index 13b91b67..01a94d43 100644 --- a/src/components/widgets/greeting/Greeting.jsx +++ b/src/components/widgets/greeting/Greeting.jsx @@ -110,6 +110,9 @@ export default class Greeting extends React.PureComponent { return element.style.display = 'none'; } + this.timer = null; + this.getGreeting(0); + element.style.display = 'block'; } }); diff --git a/src/components/widgets/time/Clock.jsx b/src/components/widgets/time/Clock.jsx index 586719a9..2908f2fd 100644 --- a/src/components/widgets/time/Clock.jsx +++ b/src/components/widgets/time/Clock.jsx @@ -96,6 +96,9 @@ export default class Clock extends React.PureComponent { return element.style.display = 'none'; } + this.timer = null; + this.startTime(0); + element.style.display = 'block'; } });