Skip to content

Commit f490da1

Browse files
committed
fix(alerts): properly render service alert body if exists
fix #107
1 parent b17ab42 commit f490da1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/components/narrative/line-itin/itinerary.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,17 @@
354354
font-size: 18px;
355355
}
356356

357+
.otp .line-itin .leg-body .transit-alerts .transit-alert .alert-header {
358+
font-size: 14px;
359+
margin-left: 30px;
360+
font-weight: 600;
361+
}
362+
357363
.otp .line-itin .leg-body .transit-alerts .transit-alert .alert-body {
358364
font-size: 12px;
359365
margin-left: 30px;
366+
/* white space pre-wrap is required to render line breaks correctly. */
367+
white-space: pre-wrap;
360368
}
361369

362370
.otp .line-itin .leg-body .transit-alerts .transit-alert .effective-date {

lib/components/narrative/line-itin/transit-leg-body.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ class AlertsBody extends Component {
216216
return (
217217
<div key={i} className='transit-alert'>
218218
<div className='alert-icon'><i className='fa fa-exclamation-triangle' /></div>
219+
{alert.alertHeaderText
220+
? <div className='alert-header'>{alert.alertHeaderText}</div>
221+
: null
222+
}
219223
<div className='alert-body'>{alert.alertDescriptionText}</div>
220224
<div className='effective-date'>{effectiveDateString}</div>
221225
</div>

0 commit comments

Comments
 (0)