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.
Files changed (191) hide show
  1. package/.github/workflows/dependabot.yml +11 -0
  2. package/.github/workflows/node.js.yml +31 -0
  3. package/.prettierrc +3 -6
  4. package/CHANGELOG.MD +5 -0
  5. package/babel.config.json +1 -1
  6. package/build/index.css +1 -2312
  7. package/build/portal.es.js +35483 -0
  8. package/build/portal.umd.js +596 -0
  9. package/{build/calendar.html → calendar.html} +2 -4
  10. package/coverage/clover.xml +28 -0
  11. package/coverage/coverage-final.json +2 -0
  12. package/coverage/lcov-report/base.css +224 -0
  13. package/coverage/lcov-report/block-navigation.js +87 -0
  14. package/coverage/lcov-report/favicon.png +0 -0
  15. package/coverage/lcov-report/helper.ts.html +142 -0
  16. package/coverage/lcov-report/index.html +116 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +196 -0
  21. package/coverage/lcov.info +36 -0
  22. package/cypress/{integration → e2e}/.examples/actions.spec.js +0 -0
  23. package/cypress/{integration → e2e}/.examples/aliasing.spec.js +0 -0
  24. package/cypress/{integration → e2e}/.examples/assertions.spec.js +0 -0
  25. package/cypress/{integration → e2e}/.examples/connectors.spec.js +0 -0
  26. package/cypress/{integration → e2e}/.examples/cookies.spec.js +0 -0
  27. package/cypress/{integration → e2e}/.examples/cypress_api.spec.js +0 -0
  28. package/cypress/{integration → e2e}/.examples/files.spec.js +0 -0
  29. package/cypress/{integration → e2e}/.examples/local_storage.spec.js +0 -0
  30. package/cypress/{integration → e2e}/.examples/location.spec.js +0 -0
  31. package/cypress/{integration → e2e}/.examples/misc.spec.js +0 -0
  32. package/cypress/{integration → e2e}/.examples/navigation.spec.js +0 -0
  33. package/cypress/{integration → e2e}/.examples/network_requests.spec.js +0 -0
  34. package/cypress/{integration → e2e}/.examples/querying.spec.js +0 -0
  35. package/cypress/{integration → e2e}/.examples/spies_stubs_clocks.spec.js +0 -0
  36. package/cypress/{integration → e2e}/.examples/traversal.spec.js +0 -0
  37. package/cypress/{integration → e2e}/.examples/utilities.spec.js +0 -0
  38. package/cypress/{integration → e2e}/.examples/viewport.spec.js +0 -0
  39. package/cypress/{integration → e2e}/.examples/waiting.spec.js +0 -0
  40. package/cypress/{integration → e2e}/.examples/window.spec.js +0 -0
  41. package/cypress/{integration → e2e}/booking.spec.js +0 -0
  42. package/cypress/{integration → e2e}/calendar.spec.js +0 -0
  43. package/cypress/{integration → e2e}/search.spec.js +0 -0
  44. package/cypress/support/commands.ts +37 -0
  45. package/cypress/support/component-index.html +12 -0
  46. package/cypress/support/component.ts +39 -0
  47. package/cypress/support/{index.js → e2e.js} +0 -0
  48. package/cypress.config.ts +15 -0
  49. package/{dev.js → dev.tsx} +1 -1
  50. package/index.html +15 -0
  51. package/{build/invalid-calendar.html → invalid-calendar.html} +0 -0
  52. package/jest.config.js +195 -0
  53. package/package.json +35 -40
  54. package/reviews.html +16 -0
  55. package/src/_lib/{SearchQueries.js → SearchQueries.ts} +8 -2
  56. package/src/_lib/{countries.js → countries.ts} +0 -0
  57. package/src/_lib/date_helper.ts +27 -0
  58. package/src/_lib/{queries.js → queries.ts} +24 -5
  59. package/src/components/App.tsx +132 -0
  60. package/src/components/AppContext.ts +14 -0
  61. package/src/components/CalendarPage/BookingForm.tsx +42 -0
  62. package/src/components/CalendarPage/Calendar.tsx +50 -0
  63. package/src/components/CalendarPage/CalendarPage.tsx +43 -0
  64. package/src/components/CalendarPage/CalendarParts/CalendarContext.tsx +89 -0
  65. package/src/components/CalendarPage/CalendarParts/CalendarHeader.tsx +72 -0
  66. package/src/components/CalendarPage/CalendarParts/DayClasses.ts +111 -0
  67. package/src/components/CalendarPage/CalendarParts/GenerateCalendar.tsx +64 -0
  68. package/src/components/CalendarPage/CalendarParts/Legend.tsx +33 -0
  69. package/src/components/CalendarPage/CalendarParts/MonthHeader.tsx +15 -0
  70. package/src/components/CalendarPage/CalendarParts/Months.tsx +37 -0
  71. package/src/components/CalendarPage/CalendarParts/RenderCells.tsx +94 -0
  72. package/src/components/CalendarPage/CalendarParts/SingleMonth.tsx +72 -0
  73. package/src/components/CalendarPage/CalendarParts/StartBooking.tsx +17 -0
  74. package/src/components/CalendarPage/CalendarParts/WeekDays.tsx +27 -0
  75. package/src/components/CalendarPage/FormCreator.tsx +213 -0
  76. package/src/components/CalendarPage/FormItems/{Date.js → Date.tsx} +10 -2
  77. package/src/components/CalendarPage/FormItems/{NumberSelect.js → NumberSelect.tsx} +1 -1
  78. package/src/components/CalendarPage/FormItems/{Select.js → Select.tsx} +0 -0
  79. package/src/components/CalendarPage/FormItems/{index.js → index.ts} +0 -0
  80. package/src/components/CalendarPage/PriceField/Price.tsx +58 -0
  81. package/src/components/CalendarPage/PriceField/Queries.ts +23 -0
  82. package/src/components/CalendarPage/PriceField/index.tsx +127 -0
  83. package/src/components/CalendarPage/Summary/{CostRow.js → CostRow.tsx} +19 -3
  84. package/src/components/CalendarPage/Summary/{CostSection.js → CostSection.tsx} +5 -1
  85. package/src/components/CalendarPage/Summary/{CostSummary.js → CostSummary.tsx} +19 -10
  86. package/src/components/CalendarPage/Summary/Description.tsx +27 -0
  87. package/src/components/CalendarPage/Summary/{InsurancesAndRequired.js → InsurancesAndRequired.tsx} +21 -2
  88. package/src/components/CalendarPage/Summary/Object.tsx +59 -0
  89. package/src/components/CalendarPage/Summary/{OnSite.js → OnSite.tsx} +9 -9
  90. package/src/components/CalendarPage/Summary/{OptionalNotOnSite.js → OptionalNotOnSite.tsx} +19 -18
  91. package/src/components/CalendarPage/Summary/{OptionalOnSite.js → OptionalOnSite.tsx} +6 -1
  92. package/src/components/CalendarPage/Summary/{Queries.js → Queries.ts} +3 -3
  93. package/src/components/CalendarPage/Summary/RentAndDiscount.tsx +30 -0
  94. package/src/components/CalendarPage/Summary/{Totals.js → Totals.tsx} +8 -3
  95. package/src/components/CalendarPage/Summary/cost_types.d.ts +31 -0
  96. package/src/components/CalendarPage/Summary/index.tsx +24 -0
  97. package/src/components/CalendarPage/calender_types.d.ts +16 -0
  98. package/src/components/CalendarPage/formParts/AssistanceMessage.tsx +60 -0
  99. package/src/components/CalendarPage/formParts/{BookingHelpers.js → BookingHelpers.tsx} +3 -3
  100. package/src/components/CalendarPage/formParts/{BookingOrOption.js → BookingOrOption.tsx} +6 -1
  101. package/src/components/CalendarPage/formParts/CancelInsuranceText.tsx +105 -0
  102. package/src/components/CalendarPage/formParts/{DefaultBookingFields.js → DefaultBookingFields.ts} +3 -1
  103. package/src/components/CalendarPage/formParts/DiscountCode.tsx +62 -0
  104. package/src/components/CalendarPage/formParts/{Guests.js → Guests.tsx} +10 -4
  105. package/src/components/CalendarPage/formParts/{OptionalBookingFields.js → OptionalBookingFields.tsx} +0 -0
  106. package/src/components/CalendarPage/formParts/{OptionalCosts.js → OptionalCosts.tsx} +1 -2
  107. package/src/components/CalendarPage/formParts/{SuccessMessage.js → SuccessMessage.tsx} +0 -0
  108. package/src/components/CalendarPage/formParts/Validations.tsx +78 -0
  109. package/src/components/CalendarPage/formParts/{discount.js → discount.tsx} +11 -2
  110. package/src/components/CalendarPage/formParts/form_types.d.ts +38 -0
  111. package/src/components/CalendarPage/formParts/{insurances.js → insurances.tsx} +14 -10
  112. package/src/components/CalendarPage/formParts/{radioButtons.js → radioButtons.tsx} +0 -0
  113. package/src/components/Error/{ApiError.js → ApiError.tsx} +6 -4
  114. package/src/components/Error/{IntegrationError.js → IntegrationError.tsx} +17 -11
  115. package/src/components/Error/{index.js → index.ts} +0 -0
  116. package/src/components/{ErrorBoundary.js → ErrorBoundary.tsx} +13 -5
  117. package/src/components/Modal/index.tsx +46 -0
  118. package/src/components/ReviewsPage/Queries.ts +26 -0
  119. package/src/components/ReviewsPage/ReviewsPage.tsx +43 -0
  120. package/src/components/ReviewsPage/Score.tsx +25 -0
  121. package/src/components/ReviewsPage/SingleReview.tsx +38 -0
  122. package/src/components/SafeBooking.tsx +97 -0
  123. package/src/components/SearchPage/Field.tsx +75 -0
  124. package/src/components/SearchPage/Filters.tsx +91 -0
  125. package/src/components/SearchPage/Paginator.tsx +63 -0
  126. package/src/components/SearchPage/Results.tsx +129 -0
  127. package/src/components/SearchPage/{SearchPage.js → SearchPage.tsx} +42 -31
  128. package/src/components/SearchPage/{SingleResult.js → SingleResult.tsx} +15 -8
  129. package/src/components/SearchPage/filters/Categories.tsx +57 -0
  130. package/src/components/SearchPage/filters/DateFilter.tsx +34 -0
  131. package/src/components/SearchPage/filters/List.tsx +80 -0
  132. package/src/components/SearchPage/filters/NumberFilter.tsx +37 -0
  133. package/src/components/SearchPage/filters/Radio.tsx +46 -0
  134. package/src/components/SearchPage/filters/Select.tsx +85 -0
  135. package/src/components/SearchPage/filters/__tests__/helper.spec.js +15 -0
  136. package/src/components/SearchPage/filters/filter_types.d.ts +25 -0
  137. package/src/components/SearchPage/filters/helper.ts +19 -0
  138. package/src/components/icons/ArrowLeft.svg.tsx +20 -0
  139. package/src/components/icons/{ArrowRight.svg.js → ArrowRight.svg.tsx} +0 -0
  140. package/src/components/icons/{Reload.svg.js → Reload.svg.tsx} +0 -0
  141. package/src/components/icons/{info.svg.js → info.svg.tsx} +0 -0
  142. package/src/components/icons/{loading.svg.js → loading.svg.tsx} +1 -1
  143. package/src/custom.d.ts +10 -0
  144. package/src/index.tsx +93 -0
  145. package/src/locales/de.json +4 -3
  146. package/src/locales/en.json +4 -3
  147. package/src/locales/es.json +4 -3
  148. package/src/locales/fr.json +4 -3
  149. package/src/locales/it.json +4 -3
  150. package/src/locales/nl.json +4 -3
  151. package/src/styles/main.css +2 -1
  152. package/src/styles/modal.css +1 -1
  153. package/src/styles/pagination.css +25 -23
  154. package/src/styles/result.css +33 -2
  155. package/src/styles/reviews.css +76 -0
  156. package/src/types.d.ts +85 -0
  157. package/tsconfig.json +17 -0
  158. package/vite.config.ts +31 -0
  159. package/build/index.html +0 -16
  160. package/build/index.js +0 -48528
  161. package/cypress.json +0 -9
  162. package/rollup.config.js +0 -30
  163. package/src/_lib/format.js +0 -16
  164. package/src/components/App.js +0 -164
  165. package/src/components/CalendarPage/BookingForm.js +0 -57
  166. package/src/components/CalendarPage/Calendar.js +0 -373
  167. package/src/components/CalendarPage/CalendarHeader.js +0 -58
  168. package/src/components/CalendarPage/CalendarPage.js +0 -158
  169. package/src/components/CalendarPage/FormCreator.js +0 -278
  170. package/src/components/CalendarPage/FormItems/Wrapper.js +0 -0
  171. package/src/components/CalendarPage/PriceField.js +0 -203
  172. package/src/components/CalendarPage/Summary/Description.js +0 -22
  173. package/src/components/CalendarPage/Summary/Object.js +0 -46
  174. package/src/components/CalendarPage/Summary/RentAndDiscount.js +0 -21
  175. package/src/components/CalendarPage/Summary/index.js +0 -19
  176. package/src/components/CalendarPage/formParts/AssistanceMessage.js +0 -47
  177. package/src/components/CalendarPage/formParts/CancelInsuranceText.js +0 -91
  178. package/src/components/CalendarPage/formParts/DiscountCode.js +0 -62
  179. package/src/components/CalendarPage/formParts/summary.js +0 -43
  180. package/src/components/Modal/index.js +0 -58
  181. package/src/components/ReviewsPage/ReviewsPage.js +0 -15
  182. package/src/components/SafeBooking.js +0 -69
  183. package/src/components/SearchPage/Field.js +0 -241
  184. package/src/components/SearchPage/Filters.js +0 -108
  185. package/src/components/SearchPage/Paginator.js +0 -59
  186. package/src/components/SearchPage/Results.js +0 -130
  187. package/src/components/SearchPage/filters/List.js +0 -63
  188. package/src/components/icons/ArrowLeft.svg.js +0 -18
  189. package/src/index.js +0 -74
  190. package/webpack.config.dev.js +0 -53
  191. package/webpack.config.js +0 -67
@@ -0,0 +1,46 @@
1
+ import React, { SyntheticEvent } from 'react';
2
+ import { Field, FiltersType, OptionsType } from './filter_types';
3
+
4
+ interface Props {
5
+ options: OptionsType[];
6
+ filters: FiltersType;
7
+ onChange: Function;
8
+ field: Field;
9
+ }
10
+
11
+ function Radio({ options, filters, onChange, field }: Props): JSX.Element {
12
+ const countries = filters.countries;
13
+
14
+ const handleChange = (event: SyntheticEvent<any>) => {
15
+ onChange(field.id, event.currentTarget.value);
16
+ };
17
+
18
+ return (
19
+ <ul className="radioList">
20
+ {options.map((opt) => (
21
+ <li
22
+ key={opt.id || opt}
23
+ className={`bu-list-item ${
24
+ countries && !countries.includes(opt.country_id)
25
+ ? 'bu-disabled'
26
+ : ''
27
+ }`}
28
+ >
29
+ <input
30
+ name={field.id}
31
+ type="radio"
32
+ id={opt.id || opt}
33
+ value={opt.id || opt}
34
+ disabled={countries ? !countries.includes(opt.country_id) : false}
35
+ // checked={value === opt.id || opt}
36
+ onBlur={handleChange}
37
+ onChange={handleChange}
38
+ />
39
+ <label htmlFor={opt.id || opt}>{opt.name || opt}</label>
40
+ </li>
41
+ ))}
42
+ </ul>
43
+ );
44
+ }
45
+
46
+ export default Radio;
@@ -0,0 +1,85 @@
1
+ import React, { SyntheticEvent } from 'react';
2
+ import { Field, FiltersType, OptionsType } from './filter_types';
3
+
4
+ interface Props {
5
+ options: OptionsType[] | string[];
6
+ field: Field;
7
+ filters: FiltersType;
8
+ value: string;
9
+ onChange: Function;
10
+ }
11
+
12
+ function Select({
13
+ options,
14
+ field,
15
+ filters,
16
+ value,
17
+ onChange
18
+ }: Props): JSX.Element {
19
+ const handleChange = (event: SyntheticEvent<any>) => {
20
+ onChange(field.id, event.currentTarget.value);
21
+ };
22
+ const countries = filters.countries;
23
+ const regions = Array.isArray(filters.regions)
24
+ ? filters.regions
25
+ : [filters.regions].filter((e) => String(e).trim());
26
+ if (options && ['countries', 'cities', 'regions'].includes(field.id)) {
27
+ return (
28
+ <select
29
+ name={field.id}
30
+ onBlur={handleChange}
31
+ onChange={handleChange}
32
+ value={value}
33
+ >
34
+ <option value="" />
35
+ {options.map((opt) => {
36
+ let hidden = false;
37
+ if (['cities', 'regions'].includes(field.id)) {
38
+ if (countries && !countries.includes(opt.country_id)) {
39
+ hidden = true;
40
+ }
41
+ if (field.id === 'cities') {
42
+ if (!regions.length === false && !regions.includes(opt.region)) {
43
+ hidden = true;
44
+ }
45
+ }
46
+ }
47
+
48
+ return (
49
+ <option
50
+ key={opt.id}
51
+ value={opt.id}
52
+ id={opt.region}
53
+ disabled={hidden}
54
+ hidden={hidden}
55
+ >
56
+ {opt.name}
57
+ </option>
58
+ );
59
+ })}
60
+ </select>
61
+ );
62
+ } else {
63
+ return (
64
+ <select
65
+ name={field.id}
66
+ onBlur={handleChange}
67
+ onChange={handleChange}
68
+ value={value}
69
+ >
70
+ <option value="" />
71
+ {options.map((opt) => {
72
+ let hidden = false;
73
+
74
+ return (
75
+ <option key={opt} value={opt} disabled={hidden} hidden={hidden}>
76
+ {opt}
77
+ </option>
78
+ );
79
+ })}
80
+ </select>
81
+ );
82
+ }
83
+ }
84
+
85
+ export default Select;
@@ -0,0 +1,15 @@
1
+ import { createNumberArray, createPriceArray } from '../helper';
2
+
3
+ describe('export numbered array', () => {
4
+ test('Small array', () => {
5
+ expect(createNumberArray(2)).toStrictEqual([0, 1, 2]);
6
+ });
7
+ });
8
+
9
+ describe('export price array', () => {
10
+ test('Small array', () => {
11
+ expect(createPriceArray(400)).toStrictEqual([0, 100, 200, 300, 400]);
12
+ });
13
+
14
+
15
+ });
@@ -0,0 +1,25 @@
1
+ export type Field = {
2
+ id: string;
3
+ type: string
4
+ };
5
+
6
+ export type FiltersType = {
7
+ countries?: any;
8
+ regions?: any;
9
+ properties?: any[];
10
+ departure_date?: string;
11
+ arrival_date?: string;
12
+ cities?: string;
13
+ persons_min?: string;
14
+ persons_max?: string;
15
+ bedrooms_min?: string;
16
+ bathrooms_min?: string;
17
+ weekprice_max?: string;
18
+ extra_search?: string;
19
+ };
20
+
21
+ export type OptionsType = {
22
+ id: string;
23
+ name: string;
24
+ country_id: string
25
+ };
@@ -0,0 +1,19 @@
1
+ export function createNumberArray(max_number: number): number[] {
2
+ return Array.from({ length: max_number + 1 }, (v, k) => k);
3
+ }
4
+
5
+ export function createPriceArray(max_price: number): number[] {
6
+ let rounded = Math.ceil(max_price / 100);
7
+ return Array.from({ length: rounded + 1 }, (v, k) => k * 100);
8
+ }
9
+
10
+ export const defaultFilter = [
11
+ {
12
+ label: 'Land',
13
+ id: 'countries',
14
+ type: 'select',
15
+ required: false,
16
+ mandatory: true,
17
+ options: ['select', 'list', 'radio', 'text']
18
+ }
19
+ ];
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ const ArrowRight = () => {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ xmlnsXlink="http://www.w3.org/1999/xlink"
8
+ version="1.1"
9
+ x="0px"
10
+ y="0px"
11
+ enableBackground="new 0 0 100 100"
12
+ viewBox="0 0 100 125"
13
+ xmlSpace="preserve"
14
+ >
15
+ <path d="M2.4,44.1l32.9-32.9c3.1-3.1,8.2-3.1,11.4,0c1.6,1.6,2.4,3.6,2.4,5.7c0,2.1-0.8,4.1-2.4,5.7L27.2,42h64.7 c2.2,0,4.2,0.9,5.7,2.4c1.5,1.5,2.4,3.5,2.4,5.7c0,4.4-3.6,8.1-8.1,8.1H27.4l19.3,19.3c1.6,1.6,2.4,3.6,2.4,5.7s-0.8,4.1-2.4,5.7 c-3.1,3.1-8.3,3.1-11.4,0L2.4,55.9C0.8,54.3,0,52.3,0,50.2c0-0.1,0-0.1,0-0.2c0-0.1,0-0.1,0-0.2C0,47.7,0.8,45.7,2.4,44.1z" />
16
+ </svg>
17
+ );
18
+ };
19
+
20
+ export default ArrowRight;
@@ -11,7 +11,7 @@ const Loading = () => (
11
11
  width="24px"
12
12
  height="30px"
13
13
  viewBox="0 0 24 30"
14
- style={{ enableBackground: 'new 0 0 50 50' }}
14
+ enableBackground="new 0 0 50 50"
15
15
  xmlSpace="preserve"
16
16
  >
17
17
  <rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2">
@@ -0,0 +1,10 @@
1
+ declare module '*.svg' {
2
+ import React = require('react');
3
+ export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
4
+ const src: string;
5
+ export default src;
6
+ }
7
+ declare module '*.json' {
8
+ const content: object;
9
+ export default content;
10
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import App from './components/App';
3
+ import { IntlProvider } from 'react-intl';
4
+ // import registerServiceWorker from './registerServiceWorker';
5
+
6
+ import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
7
+
8
+ import en from './locales/en.json';
9
+ import nl from './locales/nl.json';
10
+ import de from './locales/de.json';
11
+ import fr from './locales/fr.json';
12
+ import es from './locales/es.json';
13
+ import it from './locales/it.json';
14
+
15
+ import './styles/main.css';
16
+ import { IntegrationError } from './components/Error';
17
+ import { AppContext } from './components/AppContext';
18
+ import { LocaleType } from './types';
19
+ import { FiltersType } from './components/SearchPage/filters/filter_types';
20
+
21
+ interface Props {
22
+ portalCode: string;
23
+ objectCode: string;
24
+ pageType?: string;
25
+ locale?: LocaleType;
26
+ filters?: FiltersType;
27
+ api_url?: string;
28
+ }
29
+
30
+ function Portal({
31
+ portalCode,
32
+ objectCode,
33
+ pageType,
34
+ locale,
35
+ filters,
36
+ api_url
37
+ }: Props): JSX.Element {
38
+ const errors = IntegrationError({ portalCode, pageType, locale, filters });
39
+ if (errors) {
40
+ return errors;
41
+ }
42
+
43
+ if (!locale) {
44
+ locale = 'en';
45
+ }
46
+
47
+ const client = new ApolloClient({
48
+ uri: api_url,
49
+ cache: new InMemoryCache(),
50
+ headers: {
51
+ locale
52
+ },
53
+ defaultOptions: {
54
+ watchQuery: {
55
+ fetchPolicy: 'cache-and-network'
56
+ }
57
+ }
58
+ });
59
+
60
+ const messages: MessagesType = { en, nl, de, fr, es, it };
61
+
62
+ window.__localeId__ = locale;
63
+
64
+ return (
65
+ <ApolloProvider client={client}>
66
+ <IntlProvider locale={locale} messages={messages[locale]}>
67
+ <AppContext.Provider value={{ portalCode, objectCode, locale }}>
68
+ <App pageType={pageType} locale={locale} filters={filters} />
69
+ </AppContext.Provider>
70
+ </IntlProvider>
71
+ </ApolloProvider>
72
+ );
73
+ }
74
+
75
+ Portal.defaultProps = {
76
+ pageType: null,
77
+ api_url: 'https://api.bukazu.com/graphql'
78
+ };
79
+
80
+ export default Portal;
81
+
82
+ type MessagesType = {
83
+ en: JSONType;
84
+ nl: JSONType;
85
+ de: JSONType;
86
+ fr: JSONType;
87
+ es: JSONType;
88
+ it: JSONType;
89
+ };
90
+
91
+ type JSONType = {
92
+ [key: string]: string;
93
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Nächste",
3
+ "previous": "Vorherige",
4
4
  "price": "Preis",
5
5
  "calculate": "Nächst",
6
6
  "book": "Buchen",
@@ -111,5 +111,6 @@
111
111
  "discount_code": "Rabatt-Code",
112
112
  "minimum_nights": "Mindestens {minimum} Nächte",
113
113
  "can_only_take_insurance_in_de_be_nl": "Sie können sich nur versichern, wenn Sie in den Niederlanden, Deutschland oder Belgien wohnen.",
114
- "price_from": "Preis von"
114
+ "price_from": "Preis von",
115
+ "reviews": "Bewertungen"
115
116
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Next",
3
+ "previous": "Previous",
4
4
  "price": "Price",
5
5
  "calculate": "Next",
6
6
  "book": "Book",
@@ -112,5 +112,6 @@
112
112
  "discount_code": "Discount code",
113
113
  "minimum_nights": "At least {minimum} nights",
114
114
  "can_only_take_insurance_in_de_be_nl": "You can only take out insurance if you live in the Netherlands, Germany or Belgium.",
115
- "price_from": "Price from"
115
+ "price_from": "Price from",
116
+ "reviews": "Reviews"
116
117
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Siguiente",
3
+ "previous": "Anterior",
4
4
  "price": "Precio",
5
5
  "calculate": "Próximo",
6
6
  "book": "Reservar",
@@ -107,5 +107,6 @@
107
107
  "no": "No",
108
108
  "minimum_nights": "Al menos {minimum} noches",
109
109
  "can_only_take_insurance_in_de_be_nl": "Solo puede contratar un seguro si vive en los Países Bajos, Alemania o Bélgica.",
110
- "price_from": "Precio de"
110
+ "price_from": "Precio de",
111
+ "reviews": "Comentarios"
111
112
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Suivant",
3
+ "previous": "Précédent",
4
4
  "price": "Prix",
5
5
  "calculate": "Suivante",
6
6
  "book": "Réserver",
@@ -107,5 +107,6 @@
107
107
  "no": "Non",
108
108
  "minimum_nights": "Au moins {minimum} nuits",
109
109
  "can_only_take_insurance_in_de_be_nl": "Vous ne pouvez souscrire une assurance que si vous résidez aux Pays-Bas, en Allemagne ou en Belgique.",
110
- "price_from": "Le prix de"
110
+ "price_from": "Le prix de",
111
+ "reviews": "Critiques"
111
112
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Prossimo",
3
+ "previous": "Precedente",
4
4
  "price": "Prezzo",
5
5
  "calculate": "Prossimo",
6
6
  "book": "Prenotare",
@@ -107,5 +107,6 @@
107
107
  "no": "No",
108
108
  "minimum_nights": "Almeno {minimum} notti",
109
109
  "can_only_take_insurance_in_de_be_nl": "Puoi stipulare un'assicurazione solo se vivi nei Paesi Bassi, in Germania o in Belgio.",
110
- "price_from": "Prezzo da"
110
+ "price_from": "Prezzo da",
111
+ "reviews": "Recensioni"
111
112
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "next": "pijltje",
3
- "previous": "pijltje",
2
+ "next": "Volgende",
3
+ "previous": "Vorige",
4
4
  "price": "Prijs",
5
5
  "calculate": "Volgende",
6
6
  "book": "Boeken",
@@ -112,5 +112,6 @@
112
112
  "discount_code": "Kortingscode",
113
113
  "minimum_nights": "Minstens {minimum} nachten",
114
114
  "can_only_take_insurance_in_de_be_nl": "U kunt alleen een verzekering afsluiten, wanneer u woont in Nederland, Duitsland of België.",
115
- "price_from": "Prijs vanaf"
115
+ "price_from": "Prijs vanaf",
116
+ "reviews": "Reviews"
116
117
  }
@@ -9,6 +9,7 @@
9
9
  @import "results.css";
10
10
  @import "filters.css";
11
11
  @import "pagination.css";
12
+ @import "reviews.css";
12
13
 
13
14
  #bukazu-app {
14
15
  #search-page {
@@ -55,7 +56,7 @@
55
56
  background-size: 5px 5px, 5px 5px, 1px 1.5em;
56
57
  background-repeat: no-repeat;
57
58
  }
58
- .info-button {
59
+ .info-button {
59
60
  border: none;
60
61
  background: rgba(0, 0, 0, 0);
61
62
  cursor: pointer;
@@ -34,7 +34,7 @@
34
34
  width: 500px;
35
35
  min-height: 200px;
36
36
  max-height: 90%;
37
- top: calc(50% -150px);
37
+ top: calc(50% - 150px);
38
38
  left: calc(50% - 250px);
39
39
  box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.25);
40
40
  z-index: 3;
@@ -5,29 +5,31 @@
5
5
  list-style: none;
6
6
  border-radius: 0.25rem;
7
7
  li {
8
- position: relative;
9
- display: block;
10
- padding: 0.5rem 0.75rem;
11
- margin-left: -1px;
12
- line-height: 1.25;
13
- color: #007bff;
14
- background-color: #fff;
15
- border: 1px solid #dee2e6;
16
- &:hover {
17
- z-index: 2;
18
- color: #0056b3;
19
- text-decoration: none;
20
- background-color: #e9ecef;
21
- border-color: #dee2e6;
22
- }
23
- &:focus {
24
- z-index: 2;
25
- outline: 0;
26
- box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
27
- }
28
- &:not(:disabled):not(.disabled) {
29
- cursor: pointer;
8
+ a {
9
+ display: block;
10
+ padding: 0.5rem 0.75rem;
11
+ line-height: 1.25;
12
+ color: var(--bukazu-button);
13
+ background-color: #fff;
14
+ border: 1px solid #dee2e6;
15
+ &:hover {
16
+ z-index: 2;
17
+ color: #0056b3;
18
+ text-decoration: none;
19
+ background-color: #e9ecef;
20
+ border-color: #dee2e6;
21
+ }
22
+ &:focus {
23
+ z-index: 2;
24
+ outline: 0;
25
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
26
+ }
27
+ &:not(:disabled):not(.disabled) {
28
+ cursor: pointer;
29
+ }
30
+
30
31
  }
32
+ /* margin-left: -1px; */
31
33
  }
32
34
  }
33
35
 
@@ -40,7 +42,7 @@
40
42
  border-top-right-radius: 0.25rem;
41
43
  border-bottom-right-radius: 0.25rem;
42
44
  }
43
- .bu-pagination li.active {
45
+ .bu-pagination li.selected a {
44
46
  z-index: 1;
45
47
  color: #fff;
46
48
  background-color: var(--bukazu-button);
@@ -34,14 +34,15 @@
34
34
  min-height: 100%;
35
35
  }
36
36
  }
37
-
37
+
38
38
  .result {
39
+ position: relative;
39
40
  flex: 1 1 auto;
40
41
  display: flex;
41
42
  flex-direction: column;
42
43
  font-size: 14px;
43
44
  background: #fff;
44
- text-decoration: none;
45
+ text-decoration: none;
45
46
  &-title {
46
47
  padding: 8px;
47
48
  font-weight: bold;
@@ -59,6 +60,36 @@
59
60
  justify-content: space-evenly;
60
61
  border-bottom: 1px solid rgba(69, 74, 83, 0.2);
61
62
  }
63
+ &-rating {
64
+ position: absolute;
65
+ right: 4px;
66
+ top: 4px;
67
+ &-inner {
68
+ background: var(--bukazu-button);
69
+ position: relative;
70
+ color: #fff;
71
+ font-weight: bold;
72
+ padding: 6px 10px;
73
+ border-radius: 0.4em;
74
+ font-size: 14px;
75
+ line-height: 14px;
76
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
77
+ &:after {
78
+ content: '';
79
+ position: absolute;
80
+ bottom: 0;
81
+ left: 50%;
82
+ width: 0;
83
+ height: 0;
84
+ border: 10px solid transparent;
85
+ border-top-color: var(--bukazu-button);
86
+ border-bottom: 0;
87
+ border-left: 0;
88
+ margin-left: -5px;
89
+ margin-bottom: -10px;
90
+ }
91
+ }
92
+ }
62
93
  &-price {
63
94
  display: flex;
64
95
  flex-direction: column;
@@ -0,0 +1,76 @@
1
+ .bu_single_review {
2
+ border-bottom: 1px solid #cecece;
3
+ padding: 16px;
4
+ margin: 0 0 16px;
5
+ & .bu_review_summary {
6
+ display: flex;
7
+ align-items: center;
8
+ &__date_name {
9
+ display: flex;
10
+ align-items: center;
11
+ color: #212121;
12
+ }
13
+ &__name {
14
+ font-weight: bold;
15
+ }
16
+ }
17
+ & .bu_review {
18
+ padding: 16px 0;
19
+ font-style: italic;
20
+ margin: 0;
21
+ }
22
+ & .bu_criteria {
23
+ columns: 2;
24
+ & .bu-smaller {
25
+ columns: 1
26
+ }
27
+ }
28
+
29
+ }
30
+ .bu_score {
31
+ display: flex;
32
+ align-items: center;
33
+ padding: 0 0 4px;
34
+ &__rating {
35
+ display: inline-block;
36
+ padding: 4px 8px;
37
+ border: 1px solid #cecece;
38
+ border-radius: 4px;
39
+ color: #fff;
40
+ font-weight: bold;
41
+ margin: 0 8px 0 0;
42
+ letter-spacing: 2px;
43
+ }
44
+ &__rating.low {
45
+ background-color: #006B3D;
46
+ }
47
+ &__rating.best {
48
+ background-color: #006B3D;
49
+ }
50
+ &__rating.medium {
51
+ background-color: #069c56;
52
+ }
53
+ &__rating.good {
54
+ background-color: #069c56;
55
+ }
56
+ }
57
+ .bu_reviews {
58
+ &__overview {
59
+ background: #fefefe;
60
+ display: flex;
61
+ align-items: center;
62
+ font-size: 20px;
63
+ &__number {
64
+ font-size: 22px;
65
+ padding: 0 16px;
66
+ }
67
+ }
68
+ }
69
+
70
+ .bu-smaller {
71
+ & .bu_single_review {
72
+ & .bu_criteria {
73
+ columns: 1;
74
+ }
75
+ }
76
+ }