Skip to content

Commit 30fa8c1

Browse files
minORCray-oxd
authored andcommitted
DBC22-1147: Fix for broken styling on camera timestamp on Map
1 parent dcf9adf commit 30fa8c1

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

src/frontend/src/Components/FriendlyTime.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ export default function FriendlyTime( {date} ) {
3535
event.stopPropagation();
3636
setShowTooltip(!showTooltip)}
3737
}>
38-
<ReactTimeAgo date={date} locale="en-US"/>
38+
<p>
39+
<ReactTimeAgo date={date} locale="en-US"/>
40+
</p>
3941
<span className={"friendly-time__tooltip" + (showTooltip ? " showTooltip" : "")}>{dateFormatted}</span>
4042
</div>
4143
}
4244

4345
// else return formatted date without tooltip
4446
else {
45-
return dateFormatted;
47+
return <p className={"formatted-date" }>
48+
{dateFormatted}
49+
</p>
4650
}
4751
}

src/frontend/src/Components/Map.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ export default function MapWrapper({
373373
<img src="${featureDetails.links.imageSource}" width='300'>
374374
<div class="timestamp">
375375
<p class="driveBC">Drive<span>BC</span></p>
376-
<p>` +
377-
ReactDOMServer.renderToString(
378-
<FriendlyTime date={featureDetails.last_update_modified} />,
379-
) +
380-
`</p>
376+
` +
377+
ReactDOMServer.renderToString(
378+
<FriendlyTime date={featureDetails.last_update_modified} />,
379+
) +
380+
`
381+
</div>
381382
</div>
382383
</div>
383-
</div>
384-
</div>`;
384+
</div>`;
385385
clickedWebcam.current = featureDetails;
386386

387387
popup.current.setPosition(

src/frontend/src/Components/Map.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@
106106
background-color: $Black;
107107
padding: 0 10px;
108108
display: flex;
109-
justify-content: space-between;
109+
color: $White;
110+
font-size: 0.714em;
110111

111112
p {
112113
color: $White;
113-
font-size: 0.625em;
114114
margin-bottom: 0;
115115
}
116116

@@ -121,6 +121,10 @@
121121
}
122122
margin-right: 10px;
123123
}
124+
125+
.friendly-time, .formatted-date {
126+
margin-left: auto;
127+
}
124128
}
125129
}
126130
}

src/frontend/src/Components/cameras/WebcamCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default function WebcamCard({camera}) {
104104
}
105105
<div className="timestamp">
106106
<p className="driveBC">Drive<span>BC</span></p>
107-
<p className="label"><FriendlyTime date={camera.last_update_modified} /></p>
107+
<FriendlyTime date={camera.last_update_modified} />
108108
</div>
109109
<p className="label bold">{camera.name}</p>
110110
<p className="label">{camera.caption}</p>

src/frontend/src/pages/CameraDetailsPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export default function CameraDetailsPage() {
313313
{replay && (
314314
<div className="timestamp">
315315
<p className="driveBC">Drive<span>BC</span></p>
316-
<p className="label"><FriendlyTime date={lastUpdate} /></p>
316+
<FriendlyTime date={lastUpdate} />
317317
</div>
318318
)}
319319
</div>

0 commit comments

Comments
 (0)