Skip to content

Commit 2d6e172

Browse files
front: quick fix for speed label
1 parent d8a9f7a commit 2d6e172

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

front/src/modules/simulationResult/components/SimulationResultsMap/TrainHoverPosition.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,23 @@ function getFill(isSelectedTrain: boolean, ecoBlocks: boolean) {
2424
return '#333';
2525
}
2626

27-
function getSpeedAndTimeLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: TrainPosition) {
27+
function getSpeedLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: TrainPosition) {
2828
if (isSelectedTrain) {
2929
return (
3030
<>
3131
<span
32-
className={cx('small', 'font-weight-bold', ecoBlocks ? 'text-secondary' : 'text-primary')}
32+
className={cx('small', 'train-speed-label', 'font-weight-bold', ecoBlocks ? 'text-secondary' : 'text-primary')}
3333
>
3434
{Math.round(point?.speedTime?.speed ?? 0)}
3535
km/h
3636
</span>
37-
{point.speedTime && <span className="ml-2 small">{`${point.speedTime.time}`}</span>}
3837
</>
3938
);
4039
}
4140
return (
4241
<>
4342
{/* <small>{point.properties.name}</small> */}
44-
<span className="small ml-1 font-weight-bold text-muted">
43+
<span className="train-speed-label small ml-1 font-weight-bold text-muted">
4544
{Math.round(point?.speedTime?.speed)}
4645
km/h
4746
</span>
@@ -205,7 +204,7 @@ function TrainHoverPosition(props: TrainHoverPositionProps) {
205204
) {
206205
const { ecoBlocks } = get(allowancesSettings, train.id, {} as AllowancesSetting);
207206
const fill = getFill(isSelectedTrain as boolean, ecoBlocks);
208-
const label = getSpeedAndTimeLabel(isSelectedTrain, ecoBlocks, point);
207+
const label = getSpeedLabel(isSelectedTrain, ecoBlocks, point);
209208

210209
const zoomLengthFactor = getzoomPowerOf2LengthFactor(viewport);
211210
const [trainGeoJsonPath, headTriangle, rearTriangle] = getTrainPieces(

front/src/styles/scss/applications/operationalStudies/_simulationresults.scss

+7
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,11 @@
4343
padding: 1rem;
4444
border-radius: 4px;
4545
}
46+
47+
/* MAP */
48+
.train-speed-label {
49+
text-shadow : 0 0 3px #FFFFFF;
50+
padding-bottom: 1.5rem
51+
}
52+
4653
}

0 commit comments

Comments
 (0)