mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
show time in block (#1158)
This commit is contained in:
committed by
GitHub
parent
dffccd258f
commit
a103f8b347
@@ -180,6 +180,8 @@ export const useRuntimePlaybackOverview = () => {
|
|||||||
numEvents: state.runtime.numEvents,
|
numEvents: state.runtime.numEvents,
|
||||||
selectedEventIndex: state.runtime.selectedEventIndex,
|
selectedEventIndex: state.runtime.selectedEventIndex,
|
||||||
offset: state.runtime.offset,
|
offset: state.runtime.offset,
|
||||||
|
|
||||||
|
currentBlock: state.currentBlock,
|
||||||
});
|
});
|
||||||
|
|
||||||
return useRuntimeStore(featureSelector);
|
return useRuntimeStore(featureSelector);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ function _EditorOverview({ children }: { children: React.ReactNode }) {
|
|||||||
<TimeRow label='Actual start' value={formatedTime(actualStart)} className={style.start} />
|
<TimeRow label='Actual start' value={formatedTime(actualStart)} className={style.start} />
|
||||||
</div>
|
</div>
|
||||||
<ProgressOverview />
|
<ProgressOverview />
|
||||||
|
<CurrentBlockOverview />
|
||||||
<RuntimeOverview />
|
<RuntimeOverview />
|
||||||
<div>
|
<div>
|
||||||
<TimeRow label='Planned end' value={plannedEndText} className={style.end} daySpan={maybePlannedDaySpan} />
|
<TimeRow label='Planned end' value={plannedEndText} className={style.end} daySpan={maybePlannedDaySpan} />
|
||||||
@@ -94,6 +95,14 @@ function TitlesOverview() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CurrentBlockOverview() {
|
||||||
|
const { currentBlock, clock } = useRuntimePlaybackOverview();
|
||||||
|
|
||||||
|
const timeInBlock = formatedTime(currentBlock.startedAt === null ? null : clock - currentBlock.startedAt);
|
||||||
|
|
||||||
|
return <TimeColumn label='Time in block' value={timeInBlock} className={style.clock} />;
|
||||||
|
}
|
||||||
|
|
||||||
function TimerOverview() {
|
function TimerOverview() {
|
||||||
const { current } = useTimer();
|
const { current } = useTimer();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user