mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
style: button disable
disable playback buttons while rolling (interface only)
This commit is contained in:
@@ -6,8 +6,8 @@ export default function UnloadIconBtn(props) {
|
|||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={<FiXOctagon />}
|
icon={<FiXOctagon />}
|
||||||
colorScheme='whiteAlpha'
|
colorScheme='red'
|
||||||
backgroundColor='#ffffff05'
|
backgroundColor='#ff000022'
|
||||||
variant='outline'
|
variant='outline'
|
||||||
onClick={clickhandler}
|
onClick={clickhandler}
|
||||||
width={90}
|
width={90}
|
||||||
|
|||||||
@@ -16,17 +16,18 @@ const areEqual = (prevProps, nextProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Playback = ({ playback, selectedId, playbackControl }) => {
|
const Playback = ({ playback, selectedId, playbackControl }) => {
|
||||||
|
const isRolling = playback === 'roll';
|
||||||
return (
|
return (
|
||||||
<div className={style.playbackContainer}>
|
<div className={style.playbackContainer}>
|
||||||
<StartIconBtn
|
<StartIconBtn
|
||||||
active={playback === 'start'}
|
active={playback === 'start'}
|
||||||
clickhandler={() => playbackControl('start')}
|
clickhandler={() => playbackControl('start')}
|
||||||
disabled={!selectedId}
|
disabled={!selectedId || isRolling}
|
||||||
/>
|
/>
|
||||||
<PauseIconBtn
|
<PauseIconBtn
|
||||||
active={playback === 'pause'}
|
active={playback === 'pause'}
|
||||||
clickhandler={() => playbackControl('pause')}
|
clickhandler={() => playbackControl('pause')}
|
||||||
disabled={!selectedId}
|
disabled={!selectedId || isRolling}
|
||||||
/>
|
/>
|
||||||
<RollIconBtn
|
<RollIconBtn
|
||||||
active={playback === 'roll'}
|
active={playback === 'roll'}
|
||||||
@@ -38,6 +39,7 @@ const Playback = ({ playback, selectedId, playbackControl }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Transport = ({ playback, selectedId, playbackControl }) => {
|
const Transport = ({ playback, selectedId, playbackControl }) => {
|
||||||
|
const isRolling = playback === 'roll';
|
||||||
return (
|
return (
|
||||||
<div className={style.playbackContainer}>
|
<div className={style.playbackContainer}>
|
||||||
<PrevIconBtn
|
<PrevIconBtn
|
||||||
@@ -50,9 +52,12 @@ const Transport = ({ playback, selectedId, playbackControl }) => {
|
|||||||
/>
|
/>
|
||||||
<ReloadIconButton
|
<ReloadIconButton
|
||||||
clickhandler={() => playbackControl('reload')}
|
clickhandler={() => playbackControl('reload')}
|
||||||
disabled={!selectedId}
|
disabled={!selectedId || isRolling}
|
||||||
|
/>
|
||||||
|
<UnloadIconBtn
|
||||||
|
clickhandler={() => playbackControl('unload')}
|
||||||
|
disabled={!selectedId && !isRolling}
|
||||||
/>
|
/>
|
||||||
<UnloadIconBtn clickhandler={() => playbackControl('unload')} />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user