From f99ad830492dd620173660c656047f8ff13529ac Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Mon, 3 Feb 2025 20:01:34 +0100 Subject: [PATCH] chore: folder structure --- apps/client/src/AppRouter.tsx | 2 +- .../src/features/viewers/public/Public.tsx | 6 ++-- .../backstage/Backstage.scss | 2 +- .../viewers => views}/backstage/Backstage.tsx | 30 +++++++++---------- .../backstage/backstage.options.ts | 4 +-- .../common}/schedule/Schedule.scss | 0 .../common}/schedule/Schedule.tsx | 0 .../common}/schedule/ScheduleContext.tsx | 2 +- .../common}/schedule/ScheduleItem.tsx | 2 +- .../common}/schedule/ScheduleNav.tsx | 0 10 files changed, 24 insertions(+), 24 deletions(-) rename apps/client/src/{features/viewers => views}/backstage/Backstage.scss (98%) rename apps/client/src/{features/viewers => views}/backstage/Backstage.tsx (83%) rename apps/client/src/{features/viewers => views}/backstage/backstage.options.ts (91%) rename apps/client/src/{common/components => views/common}/schedule/Schedule.scss (100%) rename apps/client/src/{common/components => views/common}/schedule/Schedule.tsx (100%) rename apps/client/src/{common/components => views/common}/schedule/ScheduleContext.tsx (97%) rename apps/client/src/{common/components => views/common}/schedule/ScheduleItem.tsx (95%) rename apps/client/src/{common/components => views/common}/schedule/ScheduleNav.tsx (100%) diff --git a/apps/client/src/AppRouter.tsx b/apps/client/src/AppRouter.tsx index 3d31e6324..8287542ec 100644 --- a/apps/client/src/AppRouter.tsx +++ b/apps/client/src/AppRouter.tsx @@ -27,7 +27,7 @@ const MinimalTimerView = React.lazy(() => import('./features/viewers/minimal-tim const ClockView = React.lazy(() => import('./features/viewers/clock/Clock')); const Countdown = React.lazy(() => import('./features/viewers/countdown/Countdown')); -const Backstage = React.lazy(() => import('./features/viewers/backstage/Backstage')); +const Backstage = React.lazy(() => import('./views/backstage/Backstage')); const Timeline = React.lazy(() => import('./views/timeline/TimelinePage')); const Public = React.lazy(() => import('./features/viewers/public/Public')); const Lower = React.lazy(() => import('./features/viewers/lower-thirds/LowerThird')); diff --git a/apps/client/src/features/viewers/public/Public.tsx b/apps/client/src/features/viewers/public/Public.tsx index f53ddb05a..c2c08eb2f 100644 --- a/apps/client/src/features/viewers/public/Public.tsx +++ b/apps/client/src/features/viewers/public/Public.tsx @@ -3,9 +3,6 @@ import { useSearchParams } from 'react-router-dom'; import { AnimatePresence, motion } from 'framer-motion'; import { CustomFields, OntimeEvent, ProjectData, Settings } from 'ontime-types'; -import Schedule from '../../../common/components/schedule/Schedule'; -import { ScheduleProvider } from '../../../common/components/schedule/ScheduleContext'; -import ScheduleNav from '../../../common/components/schedule/ScheduleNav'; import TitleCard from '../../../common/components/title-card/TitleCard'; import ViewLogo from '../../../common/components/view-logo/ViewLogo'; import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; @@ -13,6 +10,9 @@ import { useWindowTitle } from '../../../common/hooks/useWindowTitle'; import { ViewExtendedTimer } from '../../../common/models/TimeManager.type'; import { formatTime, getDefaultFormat } from '../../../common/utils/time'; import { useTranslation } from '../../../translation/TranslationProvider'; +import Schedule from '../../../views/common/schedule/Schedule'; +import { ScheduleProvider } from '../../../views/common/schedule/ScheduleContext'; +import ScheduleNav from '../../../views/common/schedule/ScheduleNav'; import { titleVariants } from '../common/animation'; import SuperscriptTime from '../common/superscript-time/SuperscriptTime'; import { getPropertyValue } from '../common/viewUtils'; diff --git a/apps/client/src/features/viewers/backstage/Backstage.scss b/apps/client/src/views/backstage/Backstage.scss similarity index 98% rename from apps/client/src/features/viewers/backstage/Backstage.scss rename to apps/client/src/views/backstage/Backstage.scss index 6b80a5fda..d359a2c2a 100644 --- a/apps/client/src/features/viewers/backstage/Backstage.scss +++ b/apps/client/src/views/backstage/Backstage.scss @@ -1,4 +1,4 @@ -@use '../../../theme/viewerDefs' as *; +@use '../../theme/viewerDefs' as *; .backstage { margin: 0; diff --git a/apps/client/src/features/viewers/backstage/Backstage.tsx b/apps/client/src/views/backstage/Backstage.tsx similarity index 83% rename from apps/client/src/features/viewers/backstage/Backstage.tsx rename to apps/client/src/views/backstage/Backstage.tsx index f429e1844..af44661f5 100644 --- a/apps/client/src/features/viewers/backstage/Backstage.tsx +++ b/apps/client/src/views/backstage/Backstage.tsx @@ -5,21 +5,21 @@ import { AnimatePresence, motion } from 'framer-motion'; import { CustomFields, OntimeEvent, ProjectData, Settings, SupportedEvent } from 'ontime-types'; import { millisToString, removeLeadingZero } from 'ontime-utils'; -import ProgressBar from '../../../common/components/progress-bar/ProgressBar'; -import Schedule from '../../../common/components/schedule/Schedule'; -import { ScheduleProvider } from '../../../common/components/schedule/ScheduleContext'; -import ScheduleNav from '../../../common/components/schedule/ScheduleNav'; -import TitleCard from '../../../common/components/title-card/TitleCard'; -import ViewLogo from '../../../common/components/view-logo/ViewLogo'; -import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; -import { useWindowTitle } from '../../../common/hooks/useWindowTitle'; -import { ViewExtendedTimer } from '../../../common/models/TimeManager.type'; -import { timerPlaceholderMin } from '../../../common/utils/styleUtils'; -import { formatTime, getDefaultFormat } from '../../../common/utils/time'; -import { useTranslation } from '../../../translation/TranslationProvider'; -import { titleVariants } from '../common/animation'; -import SuperscriptTime from '../common/superscript-time/SuperscriptTime'; -import { getPropertyValue } from '../common/viewUtils'; +import ProgressBar from '../../common/components/progress-bar/ProgressBar'; +import TitleCard from '../../common/components/title-card/TitleCard'; +import ViewLogo from '../../common/components/view-logo/ViewLogo'; +import ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor'; +import { useWindowTitle } from '../../common/hooks/useWindowTitle'; +import { ViewExtendedTimer } from '../../common/models/TimeManager.type'; +import { timerPlaceholderMin } from '../../common/utils/styleUtils'; +import { formatTime, getDefaultFormat } from '../../common/utils/time'; +import SuperscriptTime from '../../features/viewers/common/superscript-time/SuperscriptTime'; +import { getPropertyValue } from '../../features/viewers/common/viewUtils'; +import { useTranslation } from '../../translation/TranslationProvider'; +import Schedule from '../common/schedule/Schedule'; +import { ScheduleProvider } from '../common/schedule/ScheduleContext'; +import ScheduleNav from '../common/schedule/ScheduleNav'; +import { titleVariants } from '../timer/timer.animations'; import { getBackstageOptions } from './backstage.options'; diff --git a/apps/client/src/features/viewers/backstage/backstage.options.ts b/apps/client/src/views/backstage/backstage.options.ts similarity index 91% rename from apps/client/src/features/viewers/backstage/backstage.options.ts rename to apps/client/src/views/backstage/backstage.options.ts index be763604b..620bc81fe 100644 --- a/apps/client/src/features/viewers/backstage/backstage.options.ts +++ b/apps/client/src/views/backstage/backstage.options.ts @@ -4,8 +4,8 @@ import { getTimeOption, makeOptionsFromCustomFields, OptionTitle, -} from '../../../common/components/view-params-editor/constants'; -import { ViewOption } from '../../../common/components/view-params-editor/types'; +} from '../../common/components/view-params-editor/constants'; +import { ViewOption } from '../../common/components/view-params-editor/types'; export const getBackstageOptions = (timeFormat: string, customFields: CustomFields): ViewOption[] => { const secondaryOptions = makeOptionsFromCustomFields(customFields, { note: 'Note' }); diff --git a/apps/client/src/common/components/schedule/Schedule.scss b/apps/client/src/views/common/schedule/Schedule.scss similarity index 100% rename from apps/client/src/common/components/schedule/Schedule.scss rename to apps/client/src/views/common/schedule/Schedule.scss diff --git a/apps/client/src/common/components/schedule/Schedule.tsx b/apps/client/src/views/common/schedule/Schedule.tsx similarity index 100% rename from apps/client/src/common/components/schedule/Schedule.tsx rename to apps/client/src/views/common/schedule/Schedule.tsx diff --git a/apps/client/src/common/components/schedule/ScheduleContext.tsx b/apps/client/src/views/common/schedule/ScheduleContext.tsx similarity index 97% rename from apps/client/src/common/components/schedule/ScheduleContext.tsx rename to apps/client/src/views/common/schedule/ScheduleContext.tsx index 087641a1b..6c72a6621 100644 --- a/apps/client/src/common/components/schedule/ScheduleContext.tsx +++ b/apps/client/src/views/common/schedule/ScheduleContext.tsx @@ -2,8 +2,8 @@ import { createContext, PropsWithChildren, useContext, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; import { OntimeEvent } from 'ontime-types'; +import { useInterval } from '../../../common/hooks/useInterval'; import { isStringBoolean } from '../../../features/viewers/common/viewUtils'; -import { useInterval } from '../../hooks/useInterval'; interface ScheduleContextState { events: OntimeEvent[]; diff --git a/apps/client/src/common/components/schedule/ScheduleItem.tsx b/apps/client/src/views/common/schedule/ScheduleItem.tsx similarity index 95% rename from apps/client/src/common/components/schedule/ScheduleItem.tsx rename to apps/client/src/views/common/schedule/ScheduleItem.tsx index a1029b51f..f8ee147a5 100644 --- a/apps/client/src/common/components/schedule/ScheduleItem.tsx +++ b/apps/client/src/views/common/schedule/ScheduleItem.tsx @@ -1,5 +1,5 @@ +import { formatTime } from '../../../common/utils/time'; import SuperscriptTime from '../../../features/viewers/common/superscript-time/SuperscriptTime'; -import { formatTime } from '../../utils/time'; import './Schedule.scss'; diff --git a/apps/client/src/common/components/schedule/ScheduleNav.tsx b/apps/client/src/views/common/schedule/ScheduleNav.tsx similarity index 100% rename from apps/client/src/common/components/schedule/ScheduleNav.tsx rename to apps/client/src/views/common/schedule/ScheduleNav.tsx