hotfix/92-osc timer is absolute (#92)

Fixes issues with approximating timers in the app views
This commit is contained in:
Carlos Valente
2022-01-14 20:47:39 +01:00
committed by GitHub
parent 48093b8651
commit ba782d5d22
13 changed files with 90 additions and 99 deletions
@@ -1,15 +1,16 @@
import { memo } from 'react';
import { formatDisplay } from 'common/utils/dateConfig';
import PropTypes from 'prop-types';
import styles from './Countdown.module.css';
const Countdown = ({ time, small, negative, hideZeroHours }) => {
const Countdown = ({ time, small, isNegative, hideZeroHours }) => {
// prepare display string
const display =
time != null && !isNaN(time)
? formatDisplay(time, hideZeroHours)
: '-- : -- : --';
const colour = negative ? '#ff7597' : '#fffffa';
const colour = isNegative ? '#ff7597' : '#fffffa';
return (
<div
@@ -22,3 +23,10 @@ const Countdown = ({ time, small, negative, hideZeroHours }) => {
};
export default memo(Countdown);
Countdown.propTypes = {
time: PropTypes.number.isRequired,
small: PropTypes.bool,
isNegative: PropTypes.bool,
hideZeroHour: PropTypes.bool,
};