feat: analog time settings

This commit is contained in:
David Ralph
2021-03-17 18:26:09 +00:00
parent 8f1ebb309c
commit 2454f1bbab
3 changed files with 37 additions and 5 deletions

View File

@@ -97,8 +97,22 @@ export default class Clock extends React.PureComponent {
render() {
let clockHTML = <h1 className='clock'>{this.state.time}<span className='ampm'>{this.state.ampm}</span></h1>;
const checkValue = (setting) => {
return (localStorage.getItem(setting) === 'true');
}
if (localStorage.getItem('timeType') === 'analogue') {
clockHTML = <Analog className='analogclock' value={this.state.time} renderHourMarks={false} renderMinuteMarks={false} />;
clockHTML = (
<Analog
className='analogclock'
value={this.state.time}
renderHourMarks={checkValue('hourMarks')}
renderMinuteMarks={checkValue('minuteMarks')}
renderSecondHand={checkValue('secondHand')}
renderMinuteHand={checkValue('minuteHand')}
renderHourHand={checkValue('hourHand')}
/>
);
}
return clockHTML;

View File

@@ -18,7 +18,7 @@
border: 1px solid map-get($theme-colours, 'main') !important;
}
.react-clock__hand__body {
.react-clock__hand__body, .react-clock__mark__body {
background: map-get($theme-colours, 'main') !important;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
}