mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
Feat: unify view search params (#1947)
* feat: main src in backstage view * feat: main src in timeline view * feat: main src in countdown view * feat: main src in studio view * feat: hide past events in countdown view * notes can not be set as main src * feat: show group title as secondary src * chore: spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> --------- Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ec1890c275
commit
026e24bf84
@@ -5,8 +5,10 @@ import { useAuxTimersTime, useStudioTimersSocket } from '../../common/hooks/useS
|
||||
import { getOffsetState } from '../../common/utils/offset';
|
||||
import { cx } from '../../common/utils/styleUtils';
|
||||
import { useTranslation } from '../../translation/TranslationProvider';
|
||||
import { getPropertyValue } from '../common/viewUtils';
|
||||
import { getTimerColour } from '../utils/presentation.utils';
|
||||
|
||||
import { useStudioOptions } from './studio.options';
|
||||
import { getFormattedEventData, getFormattedScheduleTimes } from './studioTimers.utils';
|
||||
|
||||
import './StudioTimers.scss';
|
||||
@@ -17,6 +19,7 @@ interface StudioTimersProps {
|
||||
|
||||
export default function StudioTimers({ viewSettings }: StudioTimersProps) {
|
||||
const { getLocalizedString } = useTranslation();
|
||||
const { mainSource } = useStudioOptions();
|
||||
const { eventNow, eventNext, message, time, offset, rundown, expectedRundownEnd } = useStudioTimersSocket();
|
||||
|
||||
const schedule = getFormattedScheduleTimes({
|
||||
@@ -24,8 +27,8 @@ export default function StudioTimers({ viewSettings }: StudioTimersProps) {
|
||||
actualStart: rundown.actualStart,
|
||||
expectedEnd: expectedRundownEnd,
|
||||
});
|
||||
const event = getFormattedEventData(eventNow, time);
|
||||
const eventNextTitle = eventNext?.title || '-';
|
||||
const event = getFormattedEventData(eventNow, time, mainSource);
|
||||
const eventNextTitle = getPropertyValue(eventNext, mainSource ?? 'title') || '-';
|
||||
const formattedTimerMessage = (message.timer.visible && message.timer.text) || '-';
|
||||
const formattedSecondaryMessage = message.timer.secondarySource === 'secondary' ? message.secondary || '-' : '-';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user