mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
Extract client timeuntil logic (#1521)
* extract * add to timeline * translate Due * fix timeline page * begin adding some tests * spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * move file * refactor * create hook * refactor * update test * spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * remove translation * explain isLinkedToLoaded * add delay to calculation * add delay value to test * spelling --------- Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b60b1beeec
commit
99dd4b4d5c
@@ -11,7 +11,6 @@ import { IoPlaySkipForward } from '@react-icons/all-files/io5/IoPlaySkipForward'
|
||||
import { IoStop } from '@react-icons/all-files/io5/IoStop';
|
||||
import { IoTime } from '@react-icons/all-files/io5/IoTime';
|
||||
import { EndAction, MaybeString, Playback, TimerType, TimeStrategy } from 'ontime-types';
|
||||
import { dayInMs } from 'ontime-utils';
|
||||
|
||||
import { cx } from '../../../common/utils/styleUtils';
|
||||
import { tooltipDelayMid } from '../../../ontimeConfig';
|
||||
@@ -47,6 +46,7 @@ interface EventBlockInnerProps {
|
||||
dayOffset: number;
|
||||
isPast: boolean;
|
||||
totalGap: number;
|
||||
isLinkedToLoaded: boolean;
|
||||
}
|
||||
|
||||
function EventBlockInner(props: EventBlockInnerProps) {
|
||||
@@ -72,6 +72,7 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
dayOffset,
|
||||
isPast,
|
||||
totalGap,
|
||||
isLinkedToLoaded,
|
||||
} = props;
|
||||
|
||||
const [renderInner, setRenderInner] = useState(false);
|
||||
@@ -120,11 +121,13 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
<EventBlockChip
|
||||
className={style.chipSection}
|
||||
id={eventId}
|
||||
trueTimeStart={timeStart + dayOffset * dayInMs}
|
||||
timeStart={timeStart}
|
||||
delay={delay}
|
||||
dayOffset={dayOffset}
|
||||
isLinkedToLoaded={isLinkedToLoaded}
|
||||
isPast={isPast}
|
||||
isLoaded={loaded}
|
||||
totalGap={totalGap}
|
||||
isLinkedAndNext={isNext && linkStart !== null}
|
||||
duration={duration}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user