feat: stage manager view

small fixes in other components
- message control fields have value from socket
- added millis to string
This commit is contained in:
cv
2021-04-18 19:20:11 +02:00
parent 2d9d330fe3
commit 8b70fc247a
5 changed files with 119 additions and 63 deletions
@@ -1,16 +1,7 @@
import { useEffect, useState } from 'react';
import { formatDisplay } from '../../dateConfig';
import styles from './Countdown.module.css';
function formatDisplay(seconds, hideZero) {
const format = (val) => `0${Math.floor(val)}`.slice(-2);
const hours = seconds / 3600;
const minutes = (seconds % 3600) / 60;
if (hideZero && hours < 1)
return [minutes, seconds % 60].map(format).join(':');
else return [hours, minutes, seconds % 60].map(format).join(':');
}
export default function Countdown(props) {
const { time, small, hideZeroHours } = props;
const [clock, setClock] = useState(time);