@autobusal/routes-order 1.23.2 → 1.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/Found/Route/Route.tsx +28 -6
- package/Found/Route/styles.ts +54 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.3
|
|
4
|
+
|
|
5
|
+
**The arrival heading was painting over the price.** Measured: the arrival cell is 165px wide and its content needed **215px**, so it ran 50px into the fare beside it.
|
|
6
|
+
|
|
7
|
+
Two causes, both fixed — widths alone would only have moved the width at which it broke:
|
|
8
|
+
|
|
9
|
+
- **No spaces to wrap at.** JSX drops the whitespace around a newline, so city, country and time were concatenated into one unbreakable token. Real spaces added, plus overflow-wrap: break-word above 640px as a backstop for a long city name on its own line.
|
|
10
|
+
- **The operator cell was taking room it did not need.** 185px to 120px with a smaller logo, and the one-row gap from 15px to 10px. That returns 85px to the two location columns, which go 165px to 208px.
|
|
11
|
+
|
|
12
|
+
Verified no overflow on any card at 1024 / 1100 / 1280 / 1440 / 1920px. 1024 is the tightest - it is where the card first lays out in a single row.
|
|
13
|
+
|
|
14
|
+
**The route code moved out of the collapsed details and under the logo**, where it sits beside the operator it identifies. That frees a slot in the details row for things that actually need explaining - customs on a cross-border run, for one.
|
|
15
|
+
|
|
16
|
+
The route information link is now **Route Info** rather than "Read Operator Information".
|
|
17
|
+
|
|
3
18
|
## 1.23.2
|
|
4
19
|
|
|
5
20
|
- Flexible Ticket detail is now behind a small **Read More** link rather than the title. Its own control, so the thing you click to *read* is never next to the thing you click to *buy*. Closed by default; one line — "without it, this ticket cannot be cancelled or changed" — stays outside the collapse, because that is the material fact and hiding it would be a dark pattern rather than a tidy layout.
|
package/Found/Route/Route.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { BiHourglass } from 'react-icons/bi';
|
|
|
5
5
|
import { RiBus2Line } from 'react-icons/ri';
|
|
6
6
|
import { formatDuration, splitPrice } from '../refine';
|
|
7
7
|
import { Button, RouteFeature, Information, Rating } from '@autobusal/common';
|
|
8
|
-
import { Container, ButtonDetails, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, Details, Detail, ButtonPolicy, TitleDetail,
|
|
8
|
+
import { Container, ButtonDetails, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, CodeCompany, Details, Detail, ButtonPolicy, TitleDetail, FeaturesItems, Leaves } from './styles';
|
|
9
9
|
import { FoundData } from '@autobusal/providers/types/routes';
|
|
10
10
|
|
|
11
11
|
// neutral placeholder so a missing/broken operator logo doesn't render the
|
|
@@ -86,12 +86,29 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
86
86
|
nothing when there is no rating yet, which is why a brand-new
|
|
87
87
|
operator does not look like a badly rated one. */ }
|
|
88
88
|
<Rating rating={ data.operator.rating } size="small" t={ t } />
|
|
89
|
+
|
|
90
|
+
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
91
|
+
The route code, moved up out of the collapsed details. It is an
|
|
92
|
+
identifier of the same kind as the logo above it, and moving it
|
|
93
|
+
here frees a slot in the details row for things that actually
|
|
94
|
+
need explaining - customs on a cross-border run, for one. */ }
|
|
95
|
+
<CodeCompany to={ bookOnUrl ?? data.link } target="_blank" rel="noopener noreferrer">{ data.code }</CodeCompany>
|
|
89
96
|
</Company>
|
|
90
97
|
|
|
91
98
|
<Location>
|
|
92
99
|
<h2>
|
|
93
100
|
{ data.locations.from.city.name }
|
|
101
|
+
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
102
|
+
REAL SPACES, and they are load-bearing. JSX drops the
|
|
103
|
+
whitespace around a newline, so city, country and time were
|
|
104
|
+
concatenated into one unbreakable token - "Thessaloniki(GRC)
|
|
105
|
+
06:00" measured 215px inside a 165px column and painted 50px
|
|
106
|
+
into the price beside it. Nothing about the widths could fix
|
|
107
|
+
that on its own: with nowhere to wrap, text will always
|
|
108
|
+
overflow eventually. */ }
|
|
109
|
+
{ ' ' }
|
|
94
110
|
<Iso>({ data.locations.from.city.country?.iso_code })</Iso>
|
|
111
|
+
{ ' ' }
|
|
95
112
|
{ data.locations.from.departure }
|
|
96
113
|
</h2>
|
|
97
114
|
|
|
@@ -111,7 +128,17 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
111
128
|
<Location>
|
|
112
129
|
<h2>
|
|
113
130
|
{ data.locations.to.city.name }
|
|
131
|
+
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
132
|
+
REAL SPACES, and they are load-bearing. JSX drops the
|
|
133
|
+
whitespace around a newline, so city, country and time were
|
|
134
|
+
concatenated into one unbreakable token - "Thessaloniki(GRC)
|
|
135
|
+
06:00" measured 215px inside a 165px column and painted 50px
|
|
136
|
+
into the price beside it. Nothing about the widths could fix
|
|
137
|
+
that on its own: with nowhere to wrap, text will always
|
|
138
|
+
overflow eventually. */ }
|
|
139
|
+
{ ' ' }
|
|
114
140
|
<Iso>({ data.locations.to.city.country?.iso_code })</Iso>
|
|
141
|
+
{ ' ' }
|
|
115
142
|
{ data.locations.to.arrival }
|
|
116
143
|
</h2>
|
|
117
144
|
|
|
@@ -182,11 +209,6 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
182
209
|
</Detail>
|
|
183
210
|
) }
|
|
184
211
|
|
|
185
|
-
<Detail>
|
|
186
|
-
<TitleDetail>{ t('routes_order.step2.route.name') }</TitleDetail>
|
|
187
|
-
<LinkRoute to={ bookOnUrl ?? data.link } target="_blank" rel="noopener noreferrer">{ data.code }</LinkRoute>
|
|
188
|
-
</Detail>
|
|
189
|
-
|
|
190
212
|
{ customs && (
|
|
191
213
|
<Detail>
|
|
192
214
|
<TitleDetail>{ t('routes_order.step2.route.customs') }</TitleDetail>
|
package/Found/Route/styles.ts
CHANGED
|
@@ -85,8 +85,15 @@ export const Trip = styled.div`
|
|
|
85
85
|
gap: 15px;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
90
|
+
* A tighter gap once every cell shares one row: four gaps at 15px spent
|
|
91
|
+
* 60px of the widest layout on whitespace, while the arrival column was
|
|
92
|
+
* overflowing by 50px.
|
|
93
|
+
*/
|
|
88
94
|
@media (min-width: 1024px) {
|
|
89
95
|
flex-wrap: nowrap;
|
|
96
|
+
gap: 10px;
|
|
90
97
|
}
|
|
91
98
|
`;
|
|
92
99
|
|
|
@@ -104,8 +111,14 @@ export const Company = styled.div`
|
|
|
104
111
|
gap: 6px;
|
|
105
112
|
align-items: flex-start;
|
|
106
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
116
|
+
* 185px down to 120px. The logo is an identifier, not the product - it
|
|
117
|
+
* only has to be recognisable - and the 65px it gives back goes to the two
|
|
118
|
+
* location columns, which were the cells actually running out of room.
|
|
119
|
+
*/
|
|
107
120
|
@media (min-width: 1024px) {
|
|
108
|
-
flex: 0 0
|
|
121
|
+
flex: 0 0 120px;
|
|
109
122
|
}
|
|
110
123
|
`;
|
|
111
124
|
|
|
@@ -164,9 +177,21 @@ export const Location = styled.div`
|
|
|
164
177
|
overflow-wrap: anywhere;
|
|
165
178
|
}
|
|
166
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
182
|
+
* break-word, not normal. Real spaces now let the heading wrap between
|
|
183
|
+
* city, country and time, which covers almost every width - but at exactly
|
|
184
|
+
* 1024px, where the card first lays out in one row and the columns are at
|
|
185
|
+
* their narrowest, "Thessaloniki" on its own still exceeds its column and
|
|
186
|
+
* a heading that cannot break simply paints over the price.
|
|
187
|
+
*
|
|
188
|
+
* break-word only splits a word when it has a line to itself and still
|
|
189
|
+
* does not fit, so the ordinary case is untouched. The phone layout's
|
|
190
|
+
* anywhere would break words it did not have to.
|
|
191
|
+
*/
|
|
167
192
|
@media (min-width: 640px) {
|
|
168
193
|
& > h2 {
|
|
169
|
-
overflow-wrap:
|
|
194
|
+
overflow-wrap: break-word;
|
|
170
195
|
}
|
|
171
196
|
}
|
|
172
197
|
`;
|
|
@@ -390,6 +415,33 @@ export const LinkCompany = styled(Link)`
|
|
|
390
415
|
|
|
391
416
|
border-radius: 8px;
|
|
392
417
|
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
421
|
+
* Smaller from the width where the card lays out in one row, since that is
|
|
422
|
+
* the only place the space was contested.
|
|
423
|
+
*/
|
|
424
|
+
@media (min-width: 1024px) {
|
|
425
|
+
max-width: 120px;
|
|
426
|
+
|
|
427
|
+
& > img {
|
|
428
|
+
${ logoBox('100%', '44px') }
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
`;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* The route code, under the logo.
|
|
435
|
+
*
|
|
436
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
437
|
+
* Moved out of the collapsed details and up beside the operator it belongs
|
|
438
|
+
* to. It is an identifier of the same kind as the logo, and putting it here
|
|
439
|
+
* frees a slot in the details row for things that genuinely need explaining.
|
|
440
|
+
*/
|
|
441
|
+
export const CodeCompany = styled(Link)`
|
|
442
|
+
font-size: ${ props => props.theme.size.xxs };
|
|
443
|
+
color: ${ props => props.theme.font.faded };
|
|
444
|
+
line-height: 1.2;
|
|
393
445
|
`;
|
|
394
446
|
|
|
395
447
|
/**
|
|
@@ -465,10 +517,6 @@ export const TitleDetail = styled.h6`
|
|
|
465
517
|
font-size: ${ props => props.theme.size.xs };
|
|
466
518
|
`;
|
|
467
519
|
|
|
468
|
-
export const LinkRoute = styled(Link)`
|
|
469
|
-
font-weight: 700;
|
|
470
|
-
`;
|
|
471
|
-
|
|
472
520
|
export const ButtonPolicy = styled.button`
|
|
473
521
|
display: flex;
|
|
474
522
|
align-items: center;
|