mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
chore: extract views directory
This commit is contained in:
committed by
Carlos Valente
parent
4cba970cda
commit
1d4ddea596
@@ -28,7 +28,7 @@ const ClockView = React.lazy(() => import('./features/viewers/clock/Clock'));
|
|||||||
const Countdown = React.lazy(() => import('./features/viewers/countdown/Countdown'));
|
const Countdown = React.lazy(() => import('./features/viewers/countdown/Countdown'));
|
||||||
|
|
||||||
const Backstage = React.lazy(() => import('./features/viewers/backstage/Backstage'));
|
const Backstage = React.lazy(() => import('./features/viewers/backstage/Backstage'));
|
||||||
const Timeline = React.lazy(() => import('./features/viewers/timeline/TimelinePage'));
|
const Timeline = React.lazy(() => import('./views/timeline/TimelinePage'));
|
||||||
const Public = React.lazy(() => import('./features/viewers/public/Public'));
|
const Public = React.lazy(() => import('./features/viewers/public/Public'));
|
||||||
const Lower = React.lazy(() => import('./features/viewers/lower-thirds/LowerThird'));
|
const Lower = React.lazy(() => import('./features/viewers/lower-thirds/LowerThird'));
|
||||||
const StudioClock = React.lazy(() => import('./features/viewers/studio/StudioClock'));
|
const StudioClock = React.lazy(() => import('./features/viewers/studio/StudioClock'));
|
||||||
|
|||||||
@@ -86,11 +86,6 @@ const withData = <P extends WithDataProps>(Component: ComponentType<P>) => {
|
|||||||
timerType: eventNow?.timerType ?? null,
|
timerType: eventNow?.timerType ?? null,
|
||||||
};
|
};
|
||||||
|
|
||||||
// // prevent render until we get all the data we need
|
|
||||||
// if (!viewSettings) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewNavigationMenu />
|
<ViewNavigationMenu />
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
@use '../../../theme/viewerDefs' as *;
|
@use '../../theme/viewerDefs' as *;
|
||||||
|
|
||||||
$timeline-height: 1rem;
|
$timeline-height: 1rem;
|
||||||
$view-background: $ui-black;
|
$view-background: $ui-black;
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
import { useTimelineStatus, useTimer } from '../../../common/hooks/useSocket';
|
import { useTimelineStatus, useTimer } from '../../common/hooks/useSocket';
|
||||||
import { getProgress } from '../../../common/utils/getProgress';
|
import { getProgress } from '../../common/utils/getProgress';
|
||||||
import { alpha, cx } from '../../../common/utils/styleUtils';
|
import { alpha, cx } from '../../common/utils/styleUtils';
|
||||||
import { formatDuration, formatTime } from '../../../common/utils/time';
|
import { formatDuration, formatTime } from '../../common/utils/time';
|
||||||
import { useTranslation } from '../../../translation/TranslationProvider';
|
import { useTranslation } from '../../translation/TranslationProvider';
|
||||||
|
|
||||||
import { getStatusLabel, getTimeToStart } from './timeline.utils';
|
import { getStatusLabel, getTimeToStart } from './timeline.utils';
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
@use '../../../theme/viewerDefs' as *;
|
@use '../../theme/viewerDefs' as *;
|
||||||
|
|
||||||
.timeline {
|
.timeline {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
+6
-7
@@ -1,12 +1,12 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { MaybeString, OntimeEvent, ProjectData, Runtime, Settings } from 'ontime-types';
|
import { MaybeString, OntimeEvent, ProjectData, Runtime, Settings } from 'ontime-types';
|
||||||
|
|
||||||
import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor';
|
import ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';
|
||||||
import { useWindowTitle } from '../../../common/hooks/useWindowTitle';
|
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
||||||
import { ViewExtendedTimer } from '../../../common/models/TimeManager.type';
|
import { ViewExtendedTimer } from '../../common/models/TimeManager.type';
|
||||||
import { formatDuration, formatTime, getDefaultFormat } from '../../../common/utils/time';
|
import { formatDuration, formatTime, getDefaultFormat } from '../../common/utils/time';
|
||||||
import { useTranslation } from '../../../translation/TranslationProvider';
|
import SuperscriptTime from '../../features/viewers/common/superscript-time/SuperscriptTime';
|
||||||
import SuperscriptTime from '../common/superscript-time/SuperscriptTime';
|
import { useTranslation } from '../../translation/TranslationProvider';
|
||||||
|
|
||||||
import Section from './timeline-section/TimelineSection';
|
import Section from './timeline-section/TimelineSection';
|
||||||
import Timeline from './Timeline';
|
import Timeline from './Timeline';
|
||||||
@@ -70,7 +70,6 @@ export default function TimelinePage(props: TimelinePageProps) {
|
|||||||
followedByStatus = `T - ${formatDuration(timeToStart)}`;
|
followedByStatus = `T - ${formatDuration(timeToStart)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='timeline'>
|
<div className='timeline'>
|
||||||
<ViewParamsEditor viewOptions={progressOptions} />
|
<ViewParamsEditor viewOptions={progressOptions} />
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { MaybeString } from 'ontime-types';
|
import { MaybeString } from 'ontime-types';
|
||||||
|
|
||||||
import { cx } from '../../../../common/utils/styleUtils';
|
import { cx } from '../../../common/utils/styleUtils';
|
||||||
|
|
||||||
interface SectionProps {
|
interface SectionProps {
|
||||||
category: 'now' | 'next';
|
category: 'now' | 'next';
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { getTimeOption } from '../../../common/components/view-params-editor/constants';
|
import { getTimeOption } from '../../common/components/view-params-editor/constants';
|
||||||
import { ViewOption } from '../../../common/components/view-params-editor/types';
|
import { ViewOption } from '../../common/components/view-params-editor/types';
|
||||||
|
|
||||||
export const getTimelineOptions = (timeFormat: string): ViewOption[] => {
|
export const getTimelineOptions = (timeFormat: string): ViewOption[] => {
|
||||||
return [
|
return [
|
||||||
+3
-3
@@ -11,9 +11,9 @@ import {
|
|||||||
MILLIS_PER_HOUR,
|
MILLIS_PER_HOUR,
|
||||||
} from 'ontime-utils';
|
} from 'ontime-utils';
|
||||||
|
|
||||||
import { clamp } from '../../../common/utils/math';
|
import { clamp } from '../../common/utils/math';
|
||||||
import { formatDuration } from '../../../common/utils/time';
|
import { formatDuration } from '../../common/utils/time';
|
||||||
import { isStringBoolean } from '../common/viewUtils';
|
import { isStringBoolean } from '../../features/viewers/common/viewUtils';
|
||||||
|
|
||||||
import type { ProgressStatus } from './TimelineEntry';
|
import type { ProgressStatus } from './TimelineEntry';
|
||||||
|
|
||||||
Reference in New Issue
Block a user