bukazu-portal-react 2.1.21 → 3.0.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/.github/workflows/dependabot.yml +11 -0
- package/.github/workflows/node.js.yml +31 -0
- package/.prettierrc +3 -6
- package/CHANGELOG.MD +5 -0
- package/babel.config.json +1 -1
- package/build/index.css +1 -2312
- package/build/portal.es.js +35483 -0
- package/build/portal.umd.js +596 -0
- package/{build/calendar.html → calendar.html} +2 -4
- package/coverage/clover.xml +28 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helper.ts.html +142 -0
- package/coverage/lcov-report/index.html +116 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +36 -0
- package/cypress/{integration → e2e}/.examples/actions.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/aliasing.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/assertions.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/connectors.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/cookies.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/cypress_api.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/files.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/local_storage.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/location.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/misc.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/navigation.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/network_requests.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/querying.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/spies_stubs_clocks.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/traversal.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/utilities.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/viewport.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/waiting.spec.js +0 -0
- package/cypress/{integration → e2e}/.examples/window.spec.js +0 -0
- package/cypress/{integration → e2e}/booking.spec.js +0 -0
- package/cypress/{integration → e2e}/calendar.spec.js +0 -0
- package/cypress/{integration → e2e}/search.spec.js +0 -0
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +39 -0
- package/cypress/support/{index.js → e2e.js} +0 -0
- package/cypress.config.ts +15 -0
- package/{dev.js → dev.tsx} +1 -1
- package/index.html +15 -0
- package/{build/invalid-calendar.html → invalid-calendar.html} +0 -0
- package/jest.config.js +195 -0
- package/package.json +35 -40
- package/reviews.html +16 -0
- package/src/_lib/{SearchQueries.js → SearchQueries.ts} +8 -2
- package/src/_lib/{countries.js → countries.ts} +0 -0
- package/src/_lib/date_helper.ts +27 -0
- package/src/_lib/{queries.js → queries.ts} +24 -5
- package/src/components/App.tsx +132 -0
- package/src/components/AppContext.ts +14 -0
- package/src/components/CalendarPage/BookingForm.tsx +42 -0
- package/src/components/CalendarPage/Calendar.tsx +50 -0
- package/src/components/CalendarPage/CalendarPage.tsx +43 -0
- package/src/components/CalendarPage/CalendarParts/CalendarContext.tsx +89 -0
- package/src/components/CalendarPage/CalendarParts/CalendarHeader.tsx +72 -0
- package/src/components/CalendarPage/CalendarParts/DayClasses.ts +111 -0
- package/src/components/CalendarPage/CalendarParts/GenerateCalendar.tsx +64 -0
- package/src/components/CalendarPage/CalendarParts/Legend.tsx +33 -0
- package/src/components/CalendarPage/CalendarParts/MonthHeader.tsx +15 -0
- package/src/components/CalendarPage/CalendarParts/Months.tsx +37 -0
- package/src/components/CalendarPage/CalendarParts/RenderCells.tsx +94 -0
- package/src/components/CalendarPage/CalendarParts/SingleMonth.tsx +72 -0
- package/src/components/CalendarPage/CalendarParts/StartBooking.tsx +17 -0
- package/src/components/CalendarPage/CalendarParts/WeekDays.tsx +27 -0
- package/src/components/CalendarPage/FormCreator.tsx +213 -0
- package/src/components/CalendarPage/FormItems/{Date.js → Date.tsx} +10 -2
- package/src/components/CalendarPage/FormItems/{NumberSelect.js → NumberSelect.tsx} +1 -1
- package/src/components/CalendarPage/FormItems/{Select.js → Select.tsx} +0 -0
- package/src/components/CalendarPage/FormItems/{index.js → index.ts} +0 -0
- package/src/components/CalendarPage/PriceField/Price.tsx +58 -0
- package/src/components/CalendarPage/PriceField/Queries.ts +23 -0
- package/src/components/CalendarPage/PriceField/index.tsx +127 -0
- package/src/components/CalendarPage/Summary/{CostRow.js → CostRow.tsx} +19 -3
- package/src/components/CalendarPage/Summary/{CostSection.js → CostSection.tsx} +5 -1
- package/src/components/CalendarPage/Summary/{CostSummary.js → CostSummary.tsx} +19 -10
- package/src/components/CalendarPage/Summary/Description.tsx +27 -0
- package/src/components/CalendarPage/Summary/{InsurancesAndRequired.js → InsurancesAndRequired.tsx} +21 -2
- package/src/components/CalendarPage/Summary/Object.tsx +59 -0
- package/src/components/CalendarPage/Summary/{OnSite.js → OnSite.tsx} +9 -9
- package/src/components/CalendarPage/Summary/{OptionalNotOnSite.js → OptionalNotOnSite.tsx} +19 -18
- package/src/components/CalendarPage/Summary/{OptionalOnSite.js → OptionalOnSite.tsx} +6 -1
- package/src/components/CalendarPage/Summary/{Queries.js → Queries.ts} +3 -3
- package/src/components/CalendarPage/Summary/RentAndDiscount.tsx +30 -0
- package/src/components/CalendarPage/Summary/{Totals.js → Totals.tsx} +8 -3
- package/src/components/CalendarPage/Summary/cost_types.d.ts +31 -0
- package/src/components/CalendarPage/Summary/index.tsx +24 -0
- package/src/components/CalendarPage/calender_types.d.ts +16 -0
- package/src/components/CalendarPage/formParts/AssistanceMessage.tsx +60 -0
- package/src/components/CalendarPage/formParts/{BookingHelpers.js → BookingHelpers.tsx} +3 -3
- package/src/components/CalendarPage/formParts/{BookingOrOption.js → BookingOrOption.tsx} +6 -1
- package/src/components/CalendarPage/formParts/CancelInsuranceText.tsx +105 -0
- package/src/components/CalendarPage/formParts/{DefaultBookingFields.js → DefaultBookingFields.ts} +3 -1
- package/src/components/CalendarPage/formParts/DiscountCode.tsx +62 -0
- package/src/components/CalendarPage/formParts/{Guests.js → Guests.tsx} +10 -4
- package/src/components/CalendarPage/formParts/{OptionalBookingFields.js → OptionalBookingFields.tsx} +0 -0
- package/src/components/CalendarPage/formParts/{OptionalCosts.js → OptionalCosts.tsx} +1 -2
- package/src/components/CalendarPage/formParts/{SuccessMessage.js → SuccessMessage.tsx} +0 -0
- package/src/components/CalendarPage/formParts/Validations.tsx +78 -0
- package/src/components/CalendarPage/formParts/{discount.js → discount.tsx} +11 -2
- package/src/components/CalendarPage/formParts/form_types.d.ts +38 -0
- package/src/components/CalendarPage/formParts/{insurances.js → insurances.tsx} +14 -10
- package/src/components/CalendarPage/formParts/{radioButtons.js → radioButtons.tsx} +0 -0
- package/src/components/Error/{ApiError.js → ApiError.tsx} +6 -4
- package/src/components/Error/{IntegrationError.js → IntegrationError.tsx} +17 -11
- package/src/components/Error/{index.js → index.ts} +0 -0
- package/src/components/{ErrorBoundary.js → ErrorBoundary.tsx} +13 -5
- package/src/components/Modal/index.tsx +46 -0
- package/src/components/ReviewsPage/Queries.ts +26 -0
- package/src/components/ReviewsPage/ReviewsPage.tsx +43 -0
- package/src/components/ReviewsPage/Score.tsx +25 -0
- package/src/components/ReviewsPage/SingleReview.tsx +38 -0
- package/src/components/SafeBooking.tsx +97 -0
- package/src/components/SearchPage/Field.tsx +75 -0
- package/src/components/SearchPage/Filters.tsx +91 -0
- package/src/components/SearchPage/Paginator.tsx +63 -0
- package/src/components/SearchPage/Results.tsx +129 -0
- package/src/components/SearchPage/{SearchPage.js → SearchPage.tsx} +42 -31
- package/src/components/SearchPage/{SingleResult.js → SingleResult.tsx} +15 -8
- package/src/components/SearchPage/filters/Categories.tsx +57 -0
- package/src/components/SearchPage/filters/DateFilter.tsx +34 -0
- package/src/components/SearchPage/filters/List.tsx +80 -0
- package/src/components/SearchPage/filters/NumberFilter.tsx +37 -0
- package/src/components/SearchPage/filters/Radio.tsx +46 -0
- package/src/components/SearchPage/filters/Select.tsx +85 -0
- package/src/components/SearchPage/filters/__tests__/helper.spec.js +15 -0
- package/src/components/SearchPage/filters/filter_types.d.ts +25 -0
- package/src/components/SearchPage/filters/helper.ts +19 -0
- package/src/components/icons/ArrowLeft.svg.tsx +20 -0
- package/src/components/icons/{ArrowRight.svg.js → ArrowRight.svg.tsx} +0 -0
- package/src/components/icons/{Reload.svg.js → Reload.svg.tsx} +0 -0
- package/src/components/icons/{info.svg.js → info.svg.tsx} +0 -0
- package/src/components/icons/{loading.svg.js → loading.svg.tsx} +1 -1
- package/src/custom.d.ts +10 -0
- package/src/index.tsx +93 -0
- package/src/locales/de.json +4 -3
- package/src/locales/en.json +4 -3
- package/src/locales/es.json +4 -3
- package/src/locales/fr.json +4 -3
- package/src/locales/it.json +4 -3
- package/src/locales/nl.json +4 -3
- package/src/styles/main.css +2 -1
- package/src/styles/modal.css +1 -1
- package/src/styles/pagination.css +25 -23
- package/src/styles/result.css +33 -2
- package/src/styles/reviews.css +76 -0
- package/src/types.d.ts +85 -0
- package/tsconfig.json +17 -0
- package/vite.config.ts +31 -0
- package/build/index.html +0 -16
- package/build/index.js +0 -48528
- package/cypress.json +0 -9
- package/rollup.config.js +0 -30
- package/src/_lib/format.js +0 -16
- package/src/components/App.js +0 -164
- package/src/components/CalendarPage/BookingForm.js +0 -57
- package/src/components/CalendarPage/Calendar.js +0 -373
- package/src/components/CalendarPage/CalendarHeader.js +0 -58
- package/src/components/CalendarPage/CalendarPage.js +0 -158
- package/src/components/CalendarPage/FormCreator.js +0 -278
- package/src/components/CalendarPage/FormItems/Wrapper.js +0 -0
- package/src/components/CalendarPage/PriceField.js +0 -203
- package/src/components/CalendarPage/Summary/Description.js +0 -22
- package/src/components/CalendarPage/Summary/Object.js +0 -46
- package/src/components/CalendarPage/Summary/RentAndDiscount.js +0 -21
- package/src/components/CalendarPage/Summary/index.js +0 -19
- package/src/components/CalendarPage/formParts/AssistanceMessage.js +0 -47
- package/src/components/CalendarPage/formParts/CancelInsuranceText.js +0 -91
- package/src/components/CalendarPage/formParts/DiscountCode.js +0 -62
- package/src/components/CalendarPage/formParts/summary.js +0 -43
- package/src/components/Modal/index.js +0 -58
- package/src/components/ReviewsPage/ReviewsPage.js +0 -15
- package/src/components/SafeBooking.js +0 -69
- package/src/components/SearchPage/Field.js +0 -241
- package/src/components/SearchPage/Filters.js +0 -108
- package/src/components/SearchPage/Paginator.js +0 -59
- package/src/components/SearchPage/Results.js +0 -130
- package/src/components/SearchPage/filters/List.js +0 -63
- package/src/components/icons/ArrowLeft.svg.js +0 -18
- package/src/index.js +0 -74
- package/webpack.config.dev.js +0 -53
- package/webpack.config.js +0 -67
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
4
|
-
import format from '../../../_lib/format';
|
|
5
|
-
|
|
6
|
-
export const Object = ({ house, values }) => {
|
|
7
|
-
const { arrivalDate, departureDate } = values
|
|
8
|
-
console.log({ values });
|
|
9
|
-
return (
|
|
10
|
-
<React.Fragment>
|
|
11
|
-
<h2>
|
|
12
|
-
<FormattedMessage id="booking_details" />
|
|
13
|
-
</h2>
|
|
14
|
-
<div className="house-details">
|
|
15
|
-
<div>{house.name}</div>
|
|
16
|
-
<img src={house.image_url} alt="" />
|
|
17
|
-
<table>
|
|
18
|
-
<tbody>
|
|
19
|
-
<tr>
|
|
20
|
-
<th>
|
|
21
|
-
<FormattedMessage id={`${house.house_type}.arrival`} />
|
|
22
|
-
</th>
|
|
23
|
-
<td className="price">
|
|
24
|
-
{format(arrivalDate.date, 'dddd DD MMMM YYYY')}
|
|
25
|
-
</td>
|
|
26
|
-
<td>{arrivalDate.arrival_time_from} - {arrivalDate.arrival_time_to}</td>
|
|
27
|
-
</tr>
|
|
28
|
-
<tr>
|
|
29
|
-
<th>
|
|
30
|
-
<FormattedMessage id={`${house.house_type}.departure`} />
|
|
31
|
-
</th>
|
|
32
|
-
<td className="price">
|
|
33
|
-
{format(departureDate.date, 'dddd DD MMMM YYYY')}
|
|
34
|
-
</td>
|
|
35
|
-
<td>{departureDate.departure_time}</td>
|
|
36
|
-
</tr>
|
|
37
|
-
</tbody>
|
|
38
|
-
</table>
|
|
39
|
-
</div>
|
|
40
|
-
</React.Fragment>
|
|
41
|
-
)};
|
|
42
|
-
|
|
43
|
-
Object.propTypes = {
|
|
44
|
-
house: PropTypes.object.isRequired,
|
|
45
|
-
values: PropTypes.object.isRequired,
|
|
46
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import CostRow from './CostRow';
|
|
3
|
-
|
|
4
|
-
export default function RentAndDiscount({ prices }) {
|
|
5
|
-
const { rent_price, discount, discounted_price } = prices
|
|
6
|
-
return (
|
|
7
|
-
<div className="costs-section">
|
|
8
|
-
<table>
|
|
9
|
-
<tbody>
|
|
10
|
-
<CostRow name='rent_price' formatName={true} amount={rent_price} />
|
|
11
|
-
{discount > 0 ? (
|
|
12
|
-
<>
|
|
13
|
-
<CostRow name='discount' formatName={true} amount={discount} />
|
|
14
|
-
<CostRow name='price_after_discount' formatName={true} amount={discounted_price} />
|
|
15
|
-
</>
|
|
16
|
-
) : null}
|
|
17
|
-
</tbody>
|
|
18
|
-
</table>
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import BookingOrOption from "../formParts/BookingOrOption";
|
|
4
|
-
import CostSummary from "./CostSummary";
|
|
5
|
-
import { Object } from "./Object";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function Summary({ values, house, locale }) {
|
|
9
|
-
console.log({ values });
|
|
10
|
-
return (
|
|
11
|
-
<div>
|
|
12
|
-
<Object house={house} values={values} />
|
|
13
|
-
<BookingOrOption house={house} />
|
|
14
|
-
<CostSummary values={values} house={house} locale={locale} />
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default Summary;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormattedMessage } from "react-intl";
|
|
3
|
-
import format from "../../../_lib/format";
|
|
4
|
-
|
|
5
|
-
const dateFormat = "dddd DD MMMM YYYY";
|
|
6
|
-
|
|
7
|
-
const AssistanceMessage = ({ arrivalDate, departureDate, house, minNights }) => {
|
|
8
|
-
|
|
9
|
-
if (departureDate.date) {
|
|
10
|
-
return (
|
|
11
|
-
<div className="assistance">
|
|
12
|
-
<FormattedMessage id={`${house.house_type}.you_picked_arrival_date`} />:{" "}
|
|
13
|
-
{format(arrivalDate.date, dateFormat)}
|
|
14
|
-
<br />
|
|
15
|
-
<FormattedMessage
|
|
16
|
-
id={`${house.house_type}.you_picked_departure_date`}
|
|
17
|
-
/>
|
|
18
|
-
: {format(departureDate.date, dateFormat)}
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (arrivalDate.date) {
|
|
24
|
-
return (
|
|
25
|
-
<div className="assistance">
|
|
26
|
-
<FormattedMessage id={`${house.house_type}.you_picked_arrival_date`} />:{" "}
|
|
27
|
-
{format(arrivalDate.date, dateFormat)}
|
|
28
|
-
<br />
|
|
29
|
-
<FormattedMessage
|
|
30
|
-
id={`${house.house_type}.pick_your_departure_in_the_calendar`}
|
|
31
|
-
/>
|
|
32
|
-
<br />
|
|
33
|
-
<FormattedMessage id='minimum_nights' values={{ minimum: minNights }} defaultMessage="Minimum {minimum} nights" />
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div className="assistance">
|
|
40
|
-
<FormattedMessage
|
|
41
|
-
id={`${house.house_type}.pick_your_arrivaldate_in_the_calendar`}
|
|
42
|
-
/>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default AssistanceMessage;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormattedMessage as FM } from 'react-intl';
|
|
3
|
-
|
|
4
|
-
const LocalizedAttachment = {
|
|
5
|
-
nl:
|
|
6
|
-
"https://insurances.bukazu.com/nl/Voorwaarden%20Annuleringsverzekering.pdf",
|
|
7
|
-
de:
|
|
8
|
-
"https://insurances.bukazu.com/de/Bedingungen%20Reiseruecktrittsversicherung.pdf",
|
|
9
|
-
en:
|
|
10
|
-
"https://insurances.bukazu.com/en/Terms%20to%20Cancellation%20Insurance.pdf",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const CancelInsuranceText = () => (
|
|
14
|
-
<React.Fragment>
|
|
15
|
-
<h2>
|
|
16
|
-
<FM id="cancel_insurance" />
|
|
17
|
-
</h2>
|
|
18
|
-
<hr />
|
|
19
|
-
<p>
|
|
20
|
-
<FM id="cancel_insurance_desc" />
|
|
21
|
-
</p>
|
|
22
|
-
<h3>
|
|
23
|
-
<FM id="cancel_insurance_normal_long" />
|
|
24
|
-
</h3>
|
|
25
|
-
<p>
|
|
26
|
-
<FM id="cancel_insurance_normal_desc" />
|
|
27
|
-
</p>
|
|
28
|
-
<h3>
|
|
29
|
-
<FM id="cancel_insurance_all_risk_long" />
|
|
30
|
-
</h3>
|
|
31
|
-
<p>
|
|
32
|
-
<FM id="cancel_insurance_all_risk_desc" />
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
<h3>
|
|
36
|
-
<FM id="terms_and_costs" />
|
|
37
|
-
</h3>
|
|
38
|
-
<h4>
|
|
39
|
-
<FM id="costs_normal_cancel_insurance" />
|
|
40
|
-
</h4>
|
|
41
|
-
<p>
|
|
42
|
-
<FM id="666_costs" />
|
|
43
|
-
</p>
|
|
44
|
-
<h4>
|
|
45
|
-
<FM id="costs_allrisk_cancel_insurance" />
|
|
46
|
-
</h4>
|
|
47
|
-
<p>
|
|
48
|
-
<FM id="847_costs" />
|
|
49
|
-
</p>
|
|
50
|
-
<p>
|
|
51
|
-
<FM id="more_information" />
|
|
52
|
-
</p>
|
|
53
|
-
<a
|
|
54
|
-
href={LocalizedAttachment[window.__localeId__]}
|
|
55
|
-
target="_blank"
|
|
56
|
-
rel="noopener noreferrer"
|
|
57
|
-
>
|
|
58
|
-
<FM id="show_terms" />
|
|
59
|
-
</a>
|
|
60
|
-
<h3>
|
|
61
|
-
<FM id="terms" />
|
|
62
|
-
</h3>
|
|
63
|
-
<ul>
|
|
64
|
-
<li>
|
|
65
|
-
<FM id="9persons_9addresses" />
|
|
66
|
-
</li>
|
|
67
|
-
<li>
|
|
68
|
-
<strong>
|
|
69
|
-
<FM id="or" />
|
|
70
|
-
</strong>
|
|
71
|
-
</li>
|
|
72
|
-
<li>
|
|
73
|
-
<FM id="9persons_4addresses" />
|
|
74
|
-
</li>
|
|
75
|
-
</ul>
|
|
76
|
-
|
|
77
|
-
<hr />
|
|
78
|
-
<h2>
|
|
79
|
-
<FM id="poliscosts" />
|
|
80
|
-
</h2>
|
|
81
|
-
<p>
|
|
82
|
-
<FM id="poliscosts_are" />
|
|
83
|
-
</p>
|
|
84
|
-
|
|
85
|
-
<p>
|
|
86
|
-
<FM id="youwillrecieve" />
|
|
87
|
-
</p>
|
|
88
|
-
</React.Fragment>
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
export default CancelInsuranceText;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Field } from 'formik';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
4
|
-
import { Mutation } from '@apollo/client/react/components';
|
|
5
|
-
import { gql } from '@apollo/client'
|
|
6
|
-
|
|
7
|
-
function DiscountCode({ house }) {
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<Mutation mutation={CHECK_DISCOUNT_CODE}>
|
|
12
|
-
{(checkCode, { loading, error, data }) => {
|
|
13
|
-
if (data) { console.log(data)}
|
|
14
|
-
return (
|
|
15
|
-
<div className="form-row inline">
|
|
16
|
-
<label htmlFor="discount_code">
|
|
17
|
-
<FormattedMessage id="discount_code" />
|
|
18
|
-
</label>
|
|
19
|
-
<Field
|
|
20
|
-
name="discount_code"
|
|
21
|
-
>
|
|
22
|
-
{({ field, form }) => {
|
|
23
|
-
return (
|
|
24
|
-
<input {...field} onChange={(e) => {
|
|
25
|
-
// console.log({ code: house.code, e: e.target.value });
|
|
26
|
-
checkCode({ variables: { code: e.target.value, house_code: house.code } });
|
|
27
|
-
form.setFieldValue(field.name, e.target.value);
|
|
28
|
-
}}></input>
|
|
29
|
-
)
|
|
30
|
-
}}
|
|
31
|
-
</Field>
|
|
32
|
-
{loading && <div className="bu_discount_code">Loading...</div>}
|
|
33
|
-
{error && <div className="bu_discount_code"><FormattedMessage id="no_discount_code_found" /></div>}
|
|
34
|
-
{data && <div className="bu_discount_code">
|
|
35
|
-
<div>{data.checkDiscountCode.name}</div>
|
|
36
|
-
{data.checkDiscountCode.use_price ? (
|
|
37
|
-
|
|
38
|
-
<div>€ {data.checkDiscountCode.price}</div>
|
|
39
|
-
) : (
|
|
40
|
-
<div>{data.checkDiscountCode.percentage}%</div>
|
|
41
|
-
)}
|
|
42
|
-
</div>}
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}}
|
|
46
|
-
</Mutation>
|
|
47
|
-
</>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const CHECK_DISCOUNT_CODE = gql`
|
|
52
|
-
mutation CheckDiscountCode($code: String!, $house_code: String!) {
|
|
53
|
-
checkDiscountCode(code: $code, house_code: $house_code) {
|
|
54
|
-
name
|
|
55
|
-
use_price
|
|
56
|
-
percentage
|
|
57
|
-
price
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
export default DiscountCode;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
4
|
-
import format from '../../../_lib/format';
|
|
5
|
-
|
|
6
|
-
export const Summary = ({ house, bookingPrice }) => (
|
|
7
|
-
<React.Fragment>
|
|
8
|
-
<h2>
|
|
9
|
-
<FormattedMessage id="booking_details" />
|
|
10
|
-
</h2>
|
|
11
|
-
<div className="house-details">
|
|
12
|
-
<div>{house.name}</div>
|
|
13
|
-
<img src={house.image_url} alt="" />
|
|
14
|
-
<table>
|
|
15
|
-
<tbody>
|
|
16
|
-
<tr>
|
|
17
|
-
<th>
|
|
18
|
-
<FormattedMessage id={`${house.house_type}.arrival`} />
|
|
19
|
-
</th>
|
|
20
|
-
<td className="price">
|
|
21
|
-
{format(bookingPrice.arrival_date, 'dddd DD MMMM YYYY')}
|
|
22
|
-
</td>
|
|
23
|
-
<td>{bookingPrice.arrival_time}</td>
|
|
24
|
-
</tr>
|
|
25
|
-
<tr>
|
|
26
|
-
<th>
|
|
27
|
-
<FormattedMessage id={`${house.house_type}.departure`} />
|
|
28
|
-
</th>
|
|
29
|
-
<td className="price">
|
|
30
|
-
{format(bookingPrice.departure_date, 'dddd DD MMMM YYYY')}
|
|
31
|
-
</td>
|
|
32
|
-
<td>{bookingPrice.departure_time}</td>
|
|
33
|
-
</tr>
|
|
34
|
-
</tbody>
|
|
35
|
-
</table>
|
|
36
|
-
</div>
|
|
37
|
-
</React.Fragment>
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
Summary.propTypes = {
|
|
41
|
-
house: PropTypes.object.isRequired,
|
|
42
|
-
bookingPrice: PropTypes.object.isRequired,
|
|
43
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
class Modal extends Component {
|
|
6
|
-
state = {
|
|
7
|
-
visible: this.props.show,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
setVisible(visible) {
|
|
11
|
-
this.setState({ visible: visible });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
const { children, buttonText } = this.props;
|
|
16
|
-
|
|
17
|
-
const { visible } = this.state;
|
|
18
|
-
if (!visible) {
|
|
19
|
-
return (
|
|
20
|
-
<a className="info-button" onClick={() => this.setVisible(true)}>
|
|
21
|
-
{buttonText}
|
|
22
|
-
</a>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className="bukazu-modal-container">
|
|
28
|
-
<div className="bukazu-modal-container-inner">
|
|
29
|
-
<div
|
|
30
|
-
className="bukazu-modal-escape"
|
|
31
|
-
onClick={() => this.setVisible(false)}
|
|
32
|
-
></div>
|
|
33
|
-
<div className="bukazu-modal">
|
|
34
|
-
<div className="bukazu-modal-content">{children}</div>
|
|
35
|
-
|
|
36
|
-
<div className="bukazu-modal-footer">
|
|
37
|
-
<a onClick={() => this.setVisible(false)}>
|
|
38
|
-
<FormattedMessage id="close" />
|
|
39
|
-
</a>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Modal.defaultProps = {
|
|
49
|
-
show: false,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
Modal.propTypes = {
|
|
53
|
-
show: PropTypes.bool,
|
|
54
|
-
children: PropTypes.node,
|
|
55
|
-
buttonText: PropTypes.node,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default Modal;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
|
|
3
|
-
class ReviewsPage extends Component {
|
|
4
|
-
constructor(props) {
|
|
5
|
-
super(props);
|
|
6
|
-
this.state = { }
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return ( <div>
|
|
10
|
-
Display Reviews
|
|
11
|
-
</div> );
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default ReviewsPage;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import pjson from '../../package.json';
|
|
3
|
-
|
|
4
|
-
const style = {
|
|
5
|
-
width: "100%",
|
|
6
|
-
padding: "16px",
|
|
7
|
-
display: "flex",
|
|
8
|
-
justifyContent: "center",
|
|
9
|
-
position: "relative"
|
|
10
|
-
};
|
|
11
|
-
const styleLink = {
|
|
12
|
-
color: "#808080",
|
|
13
|
-
fontSize: 14,
|
|
14
|
-
textDecoration: "none",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const trans = {
|
|
18
|
-
nl: {
|
|
19
|
-
url: "http://bukazu.com/veiligheid",
|
|
20
|
-
label: "Beveiligd en mogelijk gemaakt door BUKAZU",
|
|
21
|
-
},
|
|
22
|
-
en: {
|
|
23
|
-
url: "http://bukazu.com/en/security",
|
|
24
|
-
label: "Secured and made possible by BUKAZU",
|
|
25
|
-
},
|
|
26
|
-
de: {
|
|
27
|
-
url: "http://bukazu.com/de/sicherheit",
|
|
28
|
-
label: "Gesichert und ermöglicht durch BUKAZU",
|
|
29
|
-
},
|
|
30
|
-
fr: {
|
|
31
|
-
url: "http://bukazu.com/fr/securite",
|
|
32
|
-
label: "Sécurisé et rendu possible par BUKAZU",
|
|
33
|
-
},
|
|
34
|
-
es: {
|
|
35
|
-
url: "http://bukazu.com/es/seguridad",
|
|
36
|
-
label: "Asegurado y hecho posible por BUKAZU",
|
|
37
|
-
},
|
|
38
|
-
it: {
|
|
39
|
-
url: "http://bukazu.com/it/sicurezza",
|
|
40
|
-
label: "Protetto e reso possibile da BUKAZU",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function SafeBooking ({ locale }) {
|
|
45
|
-
return (
|
|
46
|
-
<div style={style}>
|
|
47
|
-
<a href={trans[locale].url} style={styleLink}>
|
|
48
|
-
<svg
|
|
49
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
-
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
51
|
-
version="1.1"
|
|
52
|
-
x="0px"
|
|
53
|
-
y="0px"
|
|
54
|
-
viewBox="0 0 100 100"
|
|
55
|
-
enableBackground="new 0 0 100 100"
|
|
56
|
-
xmlSpace="preserve"
|
|
57
|
-
width='16px'
|
|
58
|
-
height='16px'
|
|
59
|
-
style={{ marginRight: "4px", fill: "#808080" }}
|
|
60
|
-
>
|
|
61
|
-
<path d="M75.98,41.62h-2.47L73.5,29.31C73.49,15.9,62.58,4.99,49.17,5C35.76,5.01,24.85,15.92,24.86,29.33l0.02,12.31H24 c-4.61,0.01-8.35,3.75-8.34,8.36v36.65c0,4.61,3.75,8.35,8.36,8.35L76,94.97c4.61,0,8.35-3.74,8.34-8.35V49.96 C84.34,45.35,80.59,41.62,75.98,41.62z M33.84,41.64l-0.02-12.31c0-8.47,6.88-15.36,15.35-15.37c8.47,0,15.36,6.89,15.36,15.35 l0.02,12.31L33.84,41.64z" />
|
|
62
|
-
</svg>
|
|
63
|
-
{trans[locale].label} <span style={{ opacity: .5, fontSize: 9, position: 'absolute', right: 10, bottom: 0}}>v{pjson.version}</span>
|
|
64
|
-
</a>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default SafeBooking;
|