mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-01 20:39:18 +00:00
style: improve visibility of roll mode
- display message when waiting - add tooltips - block non necessary buttons when rolling
This commit is contained in:
@@ -30,17 +30,24 @@ const Playback = ({ playback, selectedId, playbackControl }) => {
|
|||||||
/>
|
/>
|
||||||
<RollIconBtn
|
<RollIconBtn
|
||||||
active={playback === 'roll'}
|
active={playback === 'roll'}
|
||||||
|
disabled={playback === 'roll'}
|
||||||
clickhandler={() => playbackControl('roll')}
|
clickhandler={() => playbackControl('roll')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Transport = ({ selectedId, playbackControl }) => {
|
const Transport = ({ playback, selectedId, playbackControl }) => {
|
||||||
return (
|
return (
|
||||||
<div className={style.playbackContainer}>
|
<div className={style.playbackContainer}>
|
||||||
<PrevIconBtn clickhandler={() => playbackControl('previous')} />
|
<PrevIconBtn
|
||||||
<NextIconBtn clickhandler={() => playbackControl('next')} />
|
clickhandler={() => playbackControl('previous')}
|
||||||
|
disabled={playback === 'roll'}
|
||||||
|
/>
|
||||||
|
<NextIconBtn
|
||||||
|
clickhandler={() => playbackControl('next')}
|
||||||
|
disabled={playback === 'roll'}
|
||||||
|
/>
|
||||||
<ReloadIconButton
|
<ReloadIconButton
|
||||||
clickhandler={() => playbackControl('reload')}
|
clickhandler={() => playbackControl('reload')}
|
||||||
disabled={!selectedId}
|
disabled={!selectedId}
|
||||||
@@ -60,6 +67,7 @@ const PlaybackButtons = (props) => {
|
|||||||
playbackControl={props.playbackControl}
|
playbackControl={props.playbackControl}
|
||||||
/>
|
/>
|
||||||
<Transport
|
<Transport
|
||||||
|
playback={playback}
|
||||||
selectedId={selectedId}
|
selectedId={selectedId}
|
||||||
playbackControl={props.playbackControl}
|
playbackControl={props.playbackControl}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default function PlaybackControl() {
|
|||||||
running: null,
|
running: null,
|
||||||
startedAt: null,
|
startedAt: null,
|
||||||
expectedFinish: null,
|
expectedFinish: null,
|
||||||
|
secondary: null,
|
||||||
});
|
});
|
||||||
const [selectedId, setSelectedId] = useState(null);
|
const [selectedId, setSelectedId] = useState(null);
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ export default function PlaybackControl() {
|
|||||||
running: null,
|
running: null,
|
||||||
startedAt: null,
|
startedAt: null,
|
||||||
expectedFinish: null,
|
expectedFinish: null,
|
||||||
|
secondary: null,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,11 @@
|
|||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rolltag {
|
||||||
|
color: #2b6cb0;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
.playbackContainer {
|
.playbackContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import style from './PlaybackControl.module.css';
|
import style from './PlaybackControl.module.css';
|
||||||
import Countdown from 'common/components/countdown/Countdown';
|
import Countdown from 'common/components/countdown/Countdown';
|
||||||
import { stringFromMillis } from 'common/dateConfig';
|
import { stringFromMillis } from 'common/dateConfig';
|
||||||
|
import { Tooltip } from '@chakra-ui/react';
|
||||||
import { Button } from '@chakra-ui/button';
|
import { Button } from '@chakra-ui/button';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
@@ -9,7 +10,8 @@ const areEqual = (prevProps, nextProps) => {
|
|||||||
prevProps.timer.running === nextProps.timer.running &&
|
prevProps.timer.running === nextProps.timer.running &&
|
||||||
prevProps.timer.expectedFinish === nextProps.timer.expectedFinish &&
|
prevProps.timer.expectedFinish === nextProps.timer.expectedFinish &&
|
||||||
prevProps.timer.startedAt === nextProps.timer.startedAt &&
|
prevProps.timer.startedAt === nextProps.timer.startedAt &&
|
||||||
prevProps.playback === nextProps.playback
|
prevProps.playback === nextProps.playback &&
|
||||||
|
prevProps.timer.secondary === nextProps.timer.secondary
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -19,6 +21,7 @@ const PlaybackTimer = (props) => {
|
|||||||
const finish = stringFromMillis(timer.expectedFinish, true);
|
const finish = stringFromMillis(timer.expectedFinish, true);
|
||||||
const isNegative = timer.running < 0;
|
const isNegative = timer.running < 0;
|
||||||
const isRolling = playback === 'roll';
|
const isRolling = playback === 'roll';
|
||||||
|
const isWaiting = timer.secondary > 0 && timer.running == null;
|
||||||
|
|
||||||
const incrementProps = {
|
const incrementProps = {
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
@@ -32,23 +35,38 @@ const PlaybackTimer = (props) => {
|
|||||||
<>
|
<>
|
||||||
<div className={style.timeContainer}>
|
<div className={style.timeContainer}>
|
||||||
<div className={style.indicators}>
|
<div className={style.indicators}>
|
||||||
<div className={isRolling ? style.indRollActive : style.indRoll} />
|
<Tooltip label='Roll mode active'>
|
||||||
|
<div className={isRolling ? style.indRollActive : style.indRoll} />
|
||||||
|
</Tooltip>
|
||||||
<div
|
<div
|
||||||
className={isNegative ? style.indNegativeActive : style.indNegative}
|
className={isNegative ? style.indNegativeActive : style.indNegative}
|
||||||
/>
|
/>
|
||||||
<div className={style.indDelay} />
|
<div className={style.indDelay} />
|
||||||
</div>
|
</div>
|
||||||
<div className={style.timer}>
|
<div className={style.timer}>
|
||||||
<Countdown time={timer?.running} small negative={isNegative} />
|
<Countdown
|
||||||
</div>
|
time={isWaiting ? timer.secondary : timer.running}
|
||||||
<div className={style.start}>
|
small
|
||||||
<span className={style.tag}>Started at </span>
|
negative={isNegative}
|
||||||
<span className={style.time}>{started}</span>
|
/>
|
||||||
</div>
|
|
||||||
<div className={style.finish}>
|
|
||||||
<span className={style.tag}>Finish at </span>
|
|
||||||
<span className={style.time}>{finish}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
{isWaiting ? (
|
||||||
|
<div className={style.start}>
|
||||||
|
<span className={style.rolltag}>Roll: Countdown to start</span>
|
||||||
|
<span className={style.time}>{''}</span>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className={style.start}>
|
||||||
|
<span className={style.tag}>Started at </span>
|
||||||
|
<span className={style.time}>{started}</span>
|
||||||
|
</div>
|
||||||
|
<div className={style.finish}>
|
||||||
|
<span className={style.tag}>Finish at </span>
|
||||||
|
<span className={style.time}>{finish}</span>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<div className={style.btn}>
|
<div className={style.btn}>
|
||||||
<Button
|
<Button
|
||||||
{...incrementProps}
|
{...incrementProps}
|
||||||
|
|||||||
Reference in New Issue
Block a user