Skip to content

Commit e9dd4a9

Browse files
committed
moved departures to flex rows
1 parent 201b584 commit e9dd4a9

File tree

2 files changed

+41
-48
lines changed

2 files changed

+41
-48
lines changed

frontend/src/App.css

+20-25
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
.right {
7474
text-align: right;
7575
padding-right: 1% !important;
76+
vertical-align: middle;
7677
}
7778

7879
/* Responsive styles */
@@ -83,42 +84,36 @@
8384
}
8485

8586
.departureNested {
86-
max-width: 25% !important;
87-
width: 25% !important;
88-
min-width: 25% !important;
89-
text-align: center ;
90-
font-size: calc(1vw + 3px) !important;
91-
position: absolute;
92-
margin-left: calc(1vw - 13px);
93-
border: none !important;
94-
padding-top: 1%;
95-
padding-left: 3% !important;
96-
padding-right: 3% !important;
97-
padding-bottom: 1% !important;
98-
line-height: inherit;
99-
height: 1.5vw;
87+
display: flex;
88+
flex-direction: column;
89+
justify-content: center;
90+
align-items: center;
91+
width: 30%;
92+
font-size: calc(1vw + 3px);
93+
text-align: center;
94+
height: 100%;
10095
}
10196

97+
.departureCancelled,
98+
.departureDelayed,
10299
.departureSev {
103-
background-color: purple !important;
104-
color: white !important;
105-
margin-top: calc(2vw + 2px);
100+
margin: 0;
101+
padding: 2px 0;
106102
font-weight: bold;
103+
color: white;
104+
min-width: 100%;
107105
}
108106

109107
.departureCancelled {
110-
background-color: red !important;
111-
color: white;
112-
font-weight: bold;
113-
margin-top: calc(0.5vw - 7px);
114-
z-index: 999;
108+
background-color: red;
115109
}
116110

117111
.departureDelayed {
118112
background-color: #ff8503;
119-
color: white;
120-
font-weight: bold;
121-
margin-top: calc(0.5vw - 7px);
113+
}
114+
115+
.departureSev {
116+
background-color: purple;
122117
}
123118

124119
.loading-container {

frontend/src/App.tsx

+21-23
Original file line numberDiff line numberDiff line change
@@ -473,31 +473,29 @@ function App() {
473473
</>
474474
)}
475475
<td key={`departure-${index}-${destIndex}-${depIndex}`} className='right'>
476-
{departure.sev && (
477-
<div
478-
key={`sev-${index}-${destIndex}-${depIndex}`}
479-
className='departureNested departureSev'
480-
>
481-
{TEXT_SEV}
482-
</div>
483-
)}
484-
{departure.cancelled && (
485-
<div
486-
key={`cancelled-${index}-${destIndex}-${depIndex}`}
487-
className='departureNested departureCancelled blinking'
488-
>
489-
{TEXT_CANCELLED}
476+
<div style={{ display: 'flex', alignItems: 'center' }}>
477+
<div className='departureNested'>
478+
{departure.cancelled ? (
479+
<div key={`cancelled-${index}-${destIndex}-${depIndex}`} className='departureCancelled blinking'>
480+
{TEXT_CANCELLED}
481+
</div>
482+
) : (
483+
departure.delayInMinutes > 0 && (
484+
<div key={`delayed-${index}-${destIndex}-${depIndex}`} className='departureDelayed'>
485+
{TEXT_DELAYED}
486+
</div>
487+
)
488+
)}
489+
{departure.sev && (
490+
<div key={`sev-${index}-${destIndex}-${depIndex}`} className='departureSev'>
491+
{TEXT_SEV}
492+
</div>
493+
)}
490494
</div>
491-
)}
492-
{(departure.delayInMinutes > 0 && !departure.cancelled) && (
493-
<div
494-
key={`delayed-${index}-${destIndex}-${depIndex}`}
495-
className='departureNested departureDelayed'
496-
>
497-
{TEXT_DELAYED}
495+
<div style={{ marginLeft: 'auto' }}>
496+
{calculateRemainingTime(departure.realtimeDepartureTime)}
498497
</div>
499-
)}
500-
{calculateRemainingTime(departure.realtimeDepartureTime)}
498+
</div>
501499
</td>
502500
</tr>
503501
))}

0 commit comments

Comments
 (0)