@autobusal/routes-order 1.11.3 → 1.12.0
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 +13 -0
- package/Found/Found.tsx +8 -6
- package/package.json +1 -1
- package/Found/Booking/Booking.tsx +0 -61
- package/Found/Booking/styles.ts +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ All notable changes to this package are documented here. This project follows
|
|
|
6
6
|
> Note: 1.8.0 was published without a changelog entry. The gap is left as-is
|
|
7
7
|
> rather than reconstructed after the fact.
|
|
8
8
|
|
|
9
|
+
## [1.12.0] - 2026-08-01
|
|
10
|
+
|
|
11
|
+
### Removed
|
|
12
|
+
|
|
13
|
+
- **The Booking.com hotel banner.** It was unmounted from `Found` earlier on
|
|
14
|
+
2026-08-01 for sitting between the date strip and the trips - advertising a
|
|
15
|
+
hotel to somebody still deciding whether they can travel at all - and the
|
|
16
|
+
component is now deleted rather than kept dormant. It was never an
|
|
17
|
+
integration, only a hand-built `searchresults.xu.html` link built from
|
|
18
|
+
`city.booking_id`; leaving the component, the column and its admin field in
|
|
19
|
+
place made it look like one. The `routes_order.step2.booking` strings and
|
|
20
|
+
the `s-ec.bstatic.com` CSP entry go with it.
|
|
21
|
+
|
|
9
22
|
## [1.11.1] - 2026-08-01
|
|
10
23
|
|
|
11
24
|
### Changed
|
package/Found/Found.tsx
CHANGED
|
@@ -90,12 +90,14 @@ const Found = ({ type, loading, data, step1, preferredStop, t, onSearch, onSave
|
|
|
90
90
|
<Dates type={ type } step1={ step1 } t={ t } onSearch={ onSearch } />
|
|
91
91
|
|
|
92
92
|
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-01
|
|
93
|
-
The Booking.com banner
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
The Booking.com banner used to sit here, between the date strip
|
|
94
|
+
and the trips, pushing the actual results below it to advertise a
|
|
95
|
+
hotel to somebody still deciding whether they can travel at all.
|
|
96
|
+
It was unmounted earlier today and the component is now removed
|
|
97
|
+
outright, along with cities.booking_id - it was never really an
|
|
98
|
+
integration, just a hand-built searchresults.xu.html link, and
|
|
99
|
+
leaving the column and its admin field behind made it look like
|
|
100
|
+
one. */ }
|
|
99
101
|
|
|
100
102
|
{ showControls && (
|
|
101
103
|
<>
|
package/package.json
CHANGED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { createDate } from '@autobusal/utilities';
|
|
3
|
-
import { Container, About, LinkBooking } from './styles';
|
|
4
|
-
import { RoutesSearchForm } from '@autobusal/routes-search/types';
|
|
5
|
-
import { FoundData } from '@autobusal/providers/types/routes';
|
|
6
|
-
import { useGetSettings } from '@autobusal/providers/services';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
data?: FoundData[]
|
|
10
|
-
step1: RoutesSearchForm
|
|
11
|
-
t: TFunction<'public'>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Booking = ({ data, step1, t }: Props): (JSX.Element | null) => {
|
|
15
|
-
const { data: settings } = useGetSettings();
|
|
16
|
-
|
|
17
|
-
if (data === undefined || data?.length === 0) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const destination = data[0].locations.to;
|
|
22
|
-
|
|
23
|
-
// stop if no booking city
|
|
24
|
-
if (destination.city.booking_id === undefined) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// stop if no booking id
|
|
29
|
-
if (settings.preferences.bookingID === undefined) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const from = createDate(step1.departure);
|
|
34
|
-
const to = getReturnDate(step1._return, from);
|
|
35
|
-
|
|
36
|
-
const location = `https://www.booking.com/searchresults.xu.html?city=${ destination.city.booking_id }&aid=&checkin_monthday=${ from.getDate() }&checkin_month=${ from.getMonth() + 1 }&checkin_year=${ from.getFullYear() }&checkout_monthday=${ to.getDate() }&checkout_month=${ to.getMonth() + 1 }&checkout_year=${ to.getFullYear() }&no_rooms=1&group_adults=2&room1=A%2CA`;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Container>
|
|
40
|
-
<About>
|
|
41
|
-
{ t('routes_order.step2.booking.title', { location: destination.city.name }) }
|
|
42
|
-
<img src="https://s-ec.bstatic.com/static/img/b26logo/booking_logo_retina/22615963add19ac6b6d715a97c8d477e8b95b7ea.png" alt="Booking.com" />
|
|
43
|
-
</About>
|
|
44
|
-
|
|
45
|
-
<LinkBooking to={ location } target="_blank" rel="noopener noreferrer">{ t('routes_order.step2.booking.search') }</LinkBooking>
|
|
46
|
-
</Container>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const getReturnDate = (_return: (string | undefined), from: Date): Date => {
|
|
51
|
-
if (_return !== undefined) {
|
|
52
|
-
return createDate(_return);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const to = new Date(from);
|
|
56
|
-
to.setDate(to.getDate() + 2);
|
|
57
|
-
|
|
58
|
-
return to;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default Booking;
|
package/Found/Booking/styles.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Link } from 'react-router-dom';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 15px;
|
|
8
|
-
margin-bottom: 15px;
|
|
9
|
-
padding: 15px;
|
|
10
|
-
background: #003580;
|
|
11
|
-
border-radius: ${ props => props.theme.borderRadius };
|
|
12
|
-
|
|
13
|
-
@media (min-width: 480px) {
|
|
14
|
-
flex-direction: row;
|
|
15
|
-
align-items: center;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const About = styled.div`
|
|
20
|
-
color: #FFFFFF;
|
|
21
|
-
font-weight: 700;
|
|
22
|
-
|
|
23
|
-
> img {
|
|
24
|
-
display: block;
|
|
25
|
-
width: 110px;
|
|
26
|
-
margin-top: 6px;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
export const LinkBooking = styled(Link)`
|
|
31
|
-
display: inline-block;
|
|
32
|
-
max-width: 150px;
|
|
33
|
-
padding: 6px 0;
|
|
34
|
-
text-align: center;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
color: #333333;
|
|
37
|
-
background: #FFFFFF;
|
|
38
|
-
border-radius: 100px;
|
|
39
|
-
transition: all 0.3s ease;
|
|
40
|
-
|
|
41
|
-
&:hover {
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
box-shadow: 0 4px 24px 0 rgba(255, 255, 255, 0.5);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@media (min-width: 480px) {
|
|
47
|
-
flex-basis: 150px;
|
|
48
|
-
margin-left: auto;
|
|
49
|
-
}
|
|
50
|
-
`;
|