mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
refactor: small fixes and style tweaks
fix: prevent reflow on editing images fix: schedule overview fix: report on all events refactor: over-under time colours fix: prevent edit on delete
This commit is contained in:
committed by
Carlos Valente
parent
1e1f547ce1
commit
ad2ef3b53f
@@ -50,12 +50,12 @@ $indeterminate-width: clamp(32px, 3vw, 48px);
|
||||
color: $ontime-delay-text;
|
||||
}
|
||||
|
||||
&--ahead {
|
||||
color: $green-500;
|
||||
&--over {
|
||||
color: $playback-over;
|
||||
}
|
||||
|
||||
&--behind {
|
||||
color: $orange-500;
|
||||
&--under {
|
||||
color: $playback-under;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useRuntimeOffset } from '../../../common/hooks/useSocket';
|
||||
import { getOffsetState } from '../../../common/utils/offset';
|
||||
import { cx } from '../../../common/utils/styleUtils';
|
||||
import { formatTime } from '../../../common/utils/time';
|
||||
import SuperscriptTime from '../../../features/viewers/common/superscript-time/SuperscriptTime';
|
||||
@@ -121,11 +122,7 @@ function ProjectedTime(props: OffsetTimeProps) {
|
||||
|
||||
const projectedOffset = offset - delay;
|
||||
const projectedTime = formatTime(time - offset, formatOptions);
|
||||
const projectedState = getOffsetState(projectedOffset);
|
||||
|
||||
return (
|
||||
<SuperscriptTime
|
||||
className={cx([projectedOffset > 0 && 'entry-times--ahead', projectedOffset < 0 && 'entry-times--behind'])}
|
||||
time={projectedTime}
|
||||
/>
|
||||
);
|
||||
return <SuperscriptTime className={`entry-times--${projectedState}`} time={projectedTime} />;
|
||||
}
|
||||
|
||||
@@ -141,12 +141,12 @@ $item-height: 3.5rem;
|
||||
color: $delay-color;
|
||||
}
|
||||
|
||||
.sub__schedule--ahead {
|
||||
color: $green-500;
|
||||
.sub__schedule--over {
|
||||
color: $playback-over
|
||||
}
|
||||
|
||||
.sub__schedule--behind {
|
||||
color: $orange-500;
|
||||
.sub__schedule--under {
|
||||
color: $playback-under
|
||||
}
|
||||
|
||||
.sub__title {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useFadeOutOnInactivity } from '../../common/hooks/useFadeOutOnInactivit
|
||||
import useFollowComponent from '../../common/hooks/useFollowComponent';
|
||||
import { useCurrentDay, useRuntimeOffset } from '../../common/hooks/useSocket';
|
||||
import { ViewExtendedTimer } from '../../common/models/TimeManager.type';
|
||||
import { getOffsetState } from '../../common/utils/offset';
|
||||
import { cx } from '../../common/utils/styleUtils';
|
||||
import { throttle } from '../../common/utils/throttle';
|
||||
import FollowButton from '../../features/operator/follow-button/FollowButton';
|
||||
@@ -134,14 +135,13 @@ function ProjectedSchedule(props: ProjectedScheduleProps) {
|
||||
|
||||
// offset is negative if we are ahead
|
||||
const projectedOffset = offset - delay;
|
||||
|
||||
const classes = cx([projectedOffset > 0 && 'sub__schedule--ahead', projectedOffset < 0 && 'sub__schedule--behind']);
|
||||
const projectState = getOffsetState(projectedOffset);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ClockTime
|
||||
value={timeStart - projectedOffset}
|
||||
className={classes}
|
||||
className={`sub__schedule--${projectState}`}
|
||||
preferredFormat12='h:mm'
|
||||
preferredFormat24='HH:mm'
|
||||
/>
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ function DurationInput({
|
||||
onClick={handleFakeFocus}
|
||||
onFocus={handleFakeFocus}
|
||||
muted={!lockedValue}
|
||||
offset={delayed ? 'behind' : undefined}
|
||||
offset={delayed ? 'over' : undefined}
|
||||
ref={textRef}
|
||||
>
|
||||
{children}
|
||||
|
||||
+4
-4
@@ -14,12 +14,12 @@
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
&.ahead {
|
||||
color: $playback-ahead;
|
||||
&.under {
|
||||
color: $playback-under;
|
||||
}
|
||||
|
||||
&.behind {
|
||||
color: $ontime-delay-text;
|
||||
&.over {
|
||||
color: $playback-over;
|
||||
}
|
||||
|
||||
&.muted {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { cx } from '../../../../common/utils/styleUtils';
|
||||
import style from './TextLikeInput.module.scss';
|
||||
|
||||
interface TextLikeInputProps extends HTMLAttributes<HTMLSpanElement> {
|
||||
offset?: 'ahead' | 'behind';
|
||||
offset?: 'over' | 'under' | 'muted' | null;
|
||||
muted?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ function TimeInputDuration({
|
||||
onClick={handleFakeFocus}
|
||||
onFocus={handleFakeFocus}
|
||||
muted={!lockedValue}
|
||||
offset={delayed ? 'behind' : undefined}
|
||||
offset={delayed ? 'over' : undefined}
|
||||
ref={textRef}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -63,12 +63,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.ahead {
|
||||
color: $playback-ahead;
|
||||
.over {
|
||||
color: $playback-over;
|
||||
}
|
||||
|
||||
.behind {
|
||||
color: $ontime-delay-text;
|
||||
.under {
|
||||
color: $playback-under;
|
||||
}
|
||||
|
||||
.muted {
|
||||
|
||||
Reference in New Issue
Block a user