mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
feat: editor layout
This commit is contained in:
committed by
Carlos Valente
parent
967e92e2c8
commit
da02ecd113
@@ -1,19 +1,73 @@
|
||||
import { memo, PropsWithChildren } from 'react';
|
||||
|
||||
import { ClockOverview, MetadataTimes, OffsetOverview, ProgressOverview, StartTimes } from './composite/TimeElements';
|
||||
import { EditorLayoutMode, useEditorLayout } from '../../views/editor/useEditorLayout';
|
||||
|
||||
import {
|
||||
ClockOverview,
|
||||
MetadataTimes,
|
||||
OffsetOverview,
|
||||
PlanningStats,
|
||||
ProgressOverview,
|
||||
StartTimesPlanning,
|
||||
StartTimesRuntime,
|
||||
} from './composite/TimeElements';
|
||||
import TitleOverview from './composite/TitleOverview';
|
||||
import { OverviewWrapper } from './OverviewWrapper';
|
||||
|
||||
import style from './Overview.module.scss';
|
||||
|
||||
export default memo(EditorOverview);
|
||||
|
||||
function EditorOverview({ children }: PropsWithChildren) {
|
||||
const { layoutMode } = useEditorLayout();
|
||||
|
||||
return (
|
||||
<OverviewWrapper navElements={children}>
|
||||
<TitleOverview />
|
||||
<StartTimes />
|
||||
<ProgressOverview />
|
||||
<OffsetOverview />
|
||||
<MetadataTimes />
|
||||
<ClockOverview />
|
||||
{layoutMode === EditorLayoutMode.PLANNING && <OverviewPlanning />}
|
||||
{layoutMode === EditorLayoutMode.TRACKING && <OverviewTracking />}
|
||||
{layoutMode === EditorLayoutMode.CONTROL && <OverviewControl />}
|
||||
</OverviewWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
function OverviewPlanning() {
|
||||
return (
|
||||
<>
|
||||
<div className={style.inline}>
|
||||
<TitleOverview />
|
||||
<StartTimesPlanning />
|
||||
<PlanningStats />
|
||||
</div>
|
||||
<ClockOverview />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function OverviewTracking() {
|
||||
return (
|
||||
<>
|
||||
<div className={style.inline}>
|
||||
<StartTimesRuntime />
|
||||
<ProgressOverview />
|
||||
<OffsetOverview />
|
||||
</div>
|
||||
<MetadataTimes />
|
||||
<ClockOverview />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function OverviewControl() {
|
||||
return (
|
||||
<>
|
||||
<TitleOverview />
|
||||
<div className={style.inline}>
|
||||
<StartTimesRuntime />
|
||||
<ProgressOverview />
|
||||
<OffsetOverview />
|
||||
</div>
|
||||
<MetadataTimes />
|
||||
<ClockOverview />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user