mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-10 00:29:41 +00:00
Make Operator Layout (#442)
* Operator Layout * style: Add OnTime colors and adjust playback block * clean: Format Code * style: Operator * fix: Revert Pnpm Lock * fix: Fix Imports
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
// remember we are targeting phones and tablets
|
// remember we are targeting phones and tablets
|
||||||
|
|
||||||
.operator {
|
@use '../../../src/theme/v2Styles' as *;
|
||||||
|
@use '../../../src/theme/ontimeColours' as *;
|
||||||
|
|
||||||
|
.operatorContainer {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
@@ -8,12 +11,12 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
color:white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.allBlocks{
|
.operatorEvents {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: scroll;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin event-block() {
|
@mixin event-block() {
|
||||||
@@ -21,14 +24,15 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
margin: 0.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scheduledEvent {
|
.scheduledEvent {
|
||||||
@include event-block();
|
@include event-block();
|
||||||
background-color: hotpink;
|
background-color: $gray-1300;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
@include event-block();
|
@include event-block();
|
||||||
background-color: gray;
|
background-color: $gray-1350;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ import { SupportedEvent } from 'ontime-types';
|
|||||||
|
|
||||||
import useRundown from '../../common/hooks-query/useRundown';
|
import useRundown from '../../common/hooks-query/useRundown';
|
||||||
|
|
||||||
import style from './Operator.module.scss';
|
|
||||||
import OpEvent from './op-event/OpEvent';
|
|
||||||
import OpBlock from './op-block/OpBlock';
|
import OpBlock from './op-block/OpBlock';
|
||||||
|
import OpEvent from './op-event/OpEvent';
|
||||||
import TimeBlock from './time-block/TimeBlock';
|
import TimeBlock from './time-block/TimeBlock';
|
||||||
|
|
||||||
|
import style from './Operator.module.scss';
|
||||||
|
|
||||||
export default function Operator() {
|
export default function Operator() {
|
||||||
// this is the data that you need, the status flag should give you possibility to create a loading state
|
// this is the data that you need, the status flag should give you possibility to create a loading state
|
||||||
// for debugging data use the react query dev tools (flower thing in the bottom left corner)
|
// for debugging data use the react query dev tools (flower thing in the bottom left corner)
|
||||||
@@ -17,34 +18,33 @@ export default function Operator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={style.operator}>
|
<div className={style.operatorContainer}>
|
||||||
<div className={style.allBlocks}>
|
<div className={style.operatorEvents}>
|
||||||
{data.map((entry) => {
|
{data.map((entry) => {
|
||||||
// there are three types of events, you a filter them by using the type property
|
// there are three types of events, you a filter them by using the type property
|
||||||
// for this view, we do not show the delay event
|
// for this view, we do not show the delay event
|
||||||
|
|
||||||
// this is a scheduled event
|
// this is a scheduled event
|
||||||
if (entry.type === SupportedEvent.Event) {
|
if (entry.type === SupportedEvent.Event) {
|
||||||
return (
|
return (
|
||||||
<div key={entry.id} className={style.scheduledEvent}>
|
<div key={entry.id} className={style.scheduledEvent}>
|
||||||
<OpEvent data={entry} />
|
<OpEvent data={entry} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is a block entry (like a section title)
|
||||||
// this is a block entry (like a section title)
|
if (entry.type === SupportedEvent.Block) {
|
||||||
if (entry.type === SupportedEvent.Block) {
|
return (
|
||||||
return (
|
<div key={entry.id} className={style.block}>
|
||||||
<div key={entry.id} className={style.block}>
|
<OpBlock data={entry} />
|
||||||
<OpBlock data={entry} />
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
}
|
||||||
}
|
return null;
|
||||||
return null;
|
})}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
<TimeBlock/>
|
<TimeBlock />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
.title{
|
.OpBlock {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
|
import { OntimeBlock } from 'ontime-types';
|
||||||
|
|
||||||
import style from './OpBlock.module.scss';
|
import style from './OpBlock.module.scss';
|
||||||
|
|
||||||
type Props = {
|
interface OpBlockProps {
|
||||||
data: any;
|
data: OntimeBlock;
|
||||||
};
|
}
|
||||||
|
|
||||||
export default function OpBlock({ data }: Props) {
|
export default function OpBlock({ data }: OpBlockProps) {
|
||||||
return (
|
return <div className={style.OpBlock}>{data.title}</div>;
|
||||||
<>
|
|
||||||
<div className={style.title}>{data.title}</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
.alias{
|
.alias {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
padding: 0.2rem;
|
padding: 0.2rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title{
|
.title {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time{
|
.time {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 0.65rem;
|
font-size: 0.65rem;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time > div {
|
.time > div {
|
||||||
margin-bottom: -4px; /* Adjust the value as needed */
|
margin-bottom: -4px; /* Adjust the value as needed */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
.title{
|
flex: 1;
|
||||||
flex: 1;
|
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
import { EventData } from 'ontime-types';
|
import { OntimeEvent } from 'ontime-types';
|
||||||
import style from './OpEvent.module.scss';
|
|
||||||
import { formatTime } from '../../../common/utils/time';
|
import { formatTime } from '../../../common/utils/time';
|
||||||
|
|
||||||
type Props = {
|
import style from './OpEvent.module.scss';
|
||||||
data: any;
|
|
||||||
|
type OpEventProps = {
|
||||||
|
data: OntimeEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function OpEvent({ data }: Props) {
|
export default function OpEvent({ data }: OpEventProps) {
|
||||||
const start = formatTime(data.timeStart, { format: 'hh:mm' });
|
const start = formatTime(data.timeStart, { format: 'hh:mm' });
|
||||||
const end = formatTime(data.timeEnd, { format: 'hh:mm' });
|
const end = formatTime(data.timeEnd, { format: 'hh:mm' });
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={style.alias}>{data.note}</div>
|
<div className={style.alias}>{data.note}</div>
|
||||||
<div className={style.title}>
|
<div className={style.title}>
|
||||||
{data.title} - {data.subtitle}
|
{data.title} - {data.subtitle}
|
||||||
</div>
|
</div>
|
||||||
<div className={style.time}>
|
<div className={style.time}>
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
.block{
|
.TimeBlock {
|
||||||
padding: 0.65rem;
|
padding: 0.65rem;
|
||||||
border: 1px solid hotpink;
|
display: flex;
|
||||||
display: flex;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.clock{
|
.clock {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
margin-right:1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,23 @@
|
|||||||
import styles from './TimeBlock.module.scss';
|
import { IoPlay } from '@react-icons/all-files/io5/IoPlay';
|
||||||
import { Play } from 'lucide-react';
|
|
||||||
import { useTimer } from '../../../common/hooks/useSocket';
|
import { useTimer } from '../../../common/hooks/useSocket';
|
||||||
import { formatTime } from '../../../common/utils/time';
|
import { formatTime } from '../../../common/utils/time';
|
||||||
|
|
||||||
type Props = {};
|
import styles from './TimeBlock.module.scss';
|
||||||
|
|
||||||
export default function TimeBlock({}: Props) {
|
export default function TimeBlock() {
|
||||||
const timer = useTimer();
|
const timer = useTimer();
|
||||||
const timeNow = formatTime(timer.clock, {
|
const timeNow = formatTime(timer.clock, {
|
||||||
showSeconds: true,
|
showSeconds: true,
|
||||||
format: 'hh:mm:ss a',
|
format: 'hh:mm:ss a',
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.block}>
|
<div className={styles.TimeBlock}>
|
||||||
<Play size={17} />
|
<IoPlay size={17} />
|
||||||
<div className={styles.clock}>{timeNow} <div>00:10:00</div></div>
|
<div className={styles.clock}>
|
||||||
|
<span className={styles.timer}>{timeNow}</span> <span className={styles.timer}>00:10:00</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1782
-1899
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user