This commit is contained in:
bakhirev 2024-12-03 17:45:13 +03:00
parent 84bee540ba
commit d019985d14
5 changed files with 14 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,15 +1,20 @@
import React from 'react';
import { t } from 'ts/helpers/Localization';
import { getShortNumber } from 'ts/helpers/formatter';
import style from '../styles/info.module.scss';
interface IInfoProps {
title: string;
duration: number;
taskInDay: number;
}
function Info({
title,
duration,
taskInDay,
}: IInfoProps): React.ReactElement | null {
return (
<div
@ -17,6 +22,7 @@ function Info({
style={{
animationDelay: `${duration + 1}s`,
}}
title={`${getShortNumber(taskInDay)} ${t('page.team.total.workSpeed.title')}`}
>
{title}
</div>

View file

@ -14,6 +14,7 @@ interface ITrackProps {
title: string;
position: string;
speed: number;
taskInDay: number;
type?: string;
canStart?: boolean;
}
@ -22,6 +23,7 @@ function Track({
title,
position,
speed,
taskInDay,
type,
canStart,
}: ITrackProps): React.ReactElement | null {
@ -39,6 +41,7 @@ function Track({
<Info
title={position}
duration={duration}
taskInDay={taskInDay}
/>
)}
<Car

View file

@ -33,6 +33,7 @@ function Races({
title={track.title}
position={track.position}
speed={track.speed}
taskInDay={track.taskInDay}
canStart={showAnimation}
/>
);

View file

@ -21,6 +21,7 @@ const TeamBuilding = observer((): React.ReactElement => {
const tracks = tracksAuth.map((statistic: any) => ({
title: statistic.author,
position: order.indexOf(statistic.taskInDay) + 1,
taskInDay: statistic.taskInDay,
speed: statistic.taskInDay / order[0],
}));