bukazu-portal-react 3.3.3 → 3.3.4

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 (184) hide show
  1. package/build/index.css +1 -1
  2. package/build/portal.es.js +19931 -20259
  3. package/build/portal.umd.js +80 -82
  4. package/package.json +9 -7
  5. package/.env.development +0 -1
  6. package/.eslintrc +0 -25
  7. package/.github/dependabot.yml +0 -11
  8. package/.github/workflows/node.js.yml +0 -31
  9. package/.github/workflows/npm-publish.yml +0 -33
  10. package/.nvmrc +0 -1
  11. package/.prettierrc +0 -6
  12. package/.vscode/settings.json +0 -24
  13. package/CHANGELOG.MD +0 -93
  14. package/babel.config.json +0 -6
  15. package/calendar.html +0 -16
  16. package/coverage/clover.xml +0 -28
  17. package/coverage/coverage-final.json +0 -2
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/favicon.png +0 -0
  21. package/coverage/lcov-report/helper.ts.html +0 -142
  22. package/coverage/lcov-report/index.html +0 -116
  23. package/coverage/lcov-report/prettify.css +0 -1
  24. package/coverage/lcov-report/prettify.js +0 -2
  25. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  26. package/coverage/lcov-report/sorter.js +0 -196
  27. package/coverage/lcov.info +0 -36
  28. package/cypress/e2e/.examples/actions.spec.js +0 -299
  29. package/cypress/e2e/.examples/aliasing.spec.js +0 -39
  30. package/cypress/e2e/.examples/assertions.spec.js +0 -177
  31. package/cypress/e2e/.examples/connectors.spec.js +0 -97
  32. package/cypress/e2e/.examples/cookies.spec.js +0 -77
  33. package/cypress/e2e/.examples/cypress_api.spec.js +0 -202
  34. package/cypress/e2e/.examples/files.spec.js +0 -89
  35. package/cypress/e2e/.examples/local_storage.spec.js +0 -52
  36. package/cypress/e2e/.examples/location.spec.js +0 -32
  37. package/cypress/e2e/.examples/misc.spec.js +0 -104
  38. package/cypress/e2e/.examples/navigation.spec.js +0 -56
  39. package/cypress/e2e/.examples/network_requests.spec.js +0 -163
  40. package/cypress/e2e/.examples/querying.spec.js +0 -114
  41. package/cypress/e2e/.examples/spies_stubs_clocks.spec.js +0 -205
  42. package/cypress/e2e/.examples/traversal.spec.js +0 -121
  43. package/cypress/e2e/.examples/utilities.spec.js +0 -110
  44. package/cypress/e2e/.examples/viewport.spec.js +0 -59
  45. package/cypress/e2e/.examples/waiting.spec.js +0 -31
  46. package/cypress/e2e/.examples/window.spec.js +0 -22
  47. package/cypress/e2e/booking.spec.js +0 -81
  48. package/cypress/e2e/calendar.spec.js +0 -21
  49. package/cypress/e2e/search.spec.js +0 -25
  50. package/cypress/fixtures/example.json +0 -5
  51. package/cypress/plugins/index.js +0 -16
  52. package/cypress/support/commands.js +0 -25
  53. package/cypress/support/commands.ts +0 -37
  54. package/cypress/support/component-index.html +0 -12
  55. package/cypress/support/component.ts +0 -39
  56. package/cypress/support/e2e.js +0 -20
  57. package/cypress.config.ts +0 -15
  58. package/dev.tsx +0 -44
  59. package/index.html +0 -15
  60. package/invalid-calendar.html +0 -16
  61. package/jest.config.js +0 -195
  62. package/postcss.config.js +0 -17
  63. package/reviews.html +0 -16
  64. package/src/_lib/SearchQueries.ts +0 -145
  65. package/src/_lib/Tracking.ts +0 -51
  66. package/src/_lib/countries/de.json +0 -998
  67. package/src/_lib/countries/en.json +0 -998
  68. package/src/_lib/countries/es.json +0 -998
  69. package/src/_lib/countries/fr.json +0 -998
  70. package/src/_lib/countries/it.json +0 -998
  71. package/src/_lib/countries/nl.json +0 -998
  72. package/src/_lib/countries.ts +0 -15
  73. package/src/_lib/date_helper.ts +0 -27
  74. package/src/_lib/queries.ts +0 -244
  75. package/src/components/App.tsx +0 -108
  76. package/src/components/AppContext.ts +0 -14
  77. package/src/components/CalendarPage/BookingForm.tsx +0 -49
  78. package/src/components/CalendarPage/Calendar.tsx +0 -49
  79. package/src/components/CalendarPage/CalendarPage.tsx +0 -43
  80. package/src/components/CalendarPage/CalendarParts/CalendarContext.tsx +0 -89
  81. package/src/components/CalendarPage/CalendarParts/CalendarHeader.tsx +0 -72
  82. package/src/components/CalendarPage/CalendarParts/DayClasses.ts +0 -113
  83. package/src/components/CalendarPage/CalendarParts/GenerateCalendar.tsx +0 -72
  84. package/src/components/CalendarPage/CalendarParts/Legend.tsx +0 -33
  85. package/src/components/CalendarPage/CalendarParts/MonthHeader.tsx +0 -15
  86. package/src/components/CalendarPage/CalendarParts/Months.tsx +0 -37
  87. package/src/components/CalendarPage/CalendarParts/RenderCells.tsx +0 -97
  88. package/src/components/CalendarPage/CalendarParts/SingleMonth.tsx +0 -72
  89. package/src/components/CalendarPage/CalendarParts/StartBooking.tsx +0 -17
  90. package/src/components/CalendarPage/CalendarParts/WeekDays.tsx +0 -27
  91. package/src/components/CalendarPage/FormCreator.tsx +0 -230
  92. package/src/components/CalendarPage/FormItems/Date.tsx +0 -61
  93. package/src/components/CalendarPage/FormItems/NumberSelect.tsx +0 -39
  94. package/src/components/CalendarPage/FormItems/Select.tsx +0 -38
  95. package/src/components/CalendarPage/FormItems/index.ts +0 -4
  96. package/src/components/CalendarPage/PriceField/Price.tsx +0 -58
  97. package/src/components/CalendarPage/PriceField/Queries.ts +0 -23
  98. package/src/components/CalendarPage/PriceField/index.tsx +0 -129
  99. package/src/components/CalendarPage/Summary/CostRow.tsx +0 -58
  100. package/src/components/CalendarPage/Summary/CostSection.tsx +0 -15
  101. package/src/components/CalendarPage/Summary/CostSummary.tsx +0 -61
  102. package/src/components/CalendarPage/Summary/Description.tsx +0 -27
  103. package/src/components/CalendarPage/Summary/InsurancesAndRequired.tsx +0 -68
  104. package/src/components/CalendarPage/Summary/Object.tsx +0 -59
  105. package/src/components/CalendarPage/Summary/OnSite.tsx +0 -36
  106. package/src/components/CalendarPage/Summary/OptionalNotOnSite.tsx +0 -43
  107. package/src/components/CalendarPage/Summary/OptionalOnSite.tsx +0 -39
  108. package/src/components/CalendarPage/Summary/Queries.ts +0 -31
  109. package/src/components/CalendarPage/Summary/RentAndDiscount.tsx +0 -30
  110. package/src/components/CalendarPage/Summary/Totals.tsx +0 -89
  111. package/src/components/CalendarPage/Summary/cost_types.d.ts +0 -31
  112. package/src/components/CalendarPage/Summary/index.tsx +0 -24
  113. package/src/components/CalendarPage/calender_types.d.ts +0 -16
  114. package/src/components/CalendarPage/formParts/AssistanceMessage.tsx +0 -60
  115. package/src/components/CalendarPage/formParts/BookingHelpers.tsx +0 -47
  116. package/src/components/CalendarPage/formParts/BookingOrOption.tsx +0 -35
  117. package/src/components/CalendarPage/formParts/CancelInsuranceText.tsx +0 -69
  118. package/src/components/CalendarPage/formParts/DefaultBookingFields.ts +0 -105
  119. package/src/components/CalendarPage/formParts/DiscountCode.tsx +0 -62
  120. package/src/components/CalendarPage/formParts/Guests.tsx +0 -77
  121. package/src/components/CalendarPage/formParts/OptionalBookingFields.tsx +0 -148
  122. package/src/components/CalendarPage/formParts/OptionalCosts.tsx +0 -103
  123. package/src/components/CalendarPage/formParts/SuccessMessage.tsx +0 -31
  124. package/src/components/CalendarPage/formParts/Validations.tsx +0 -64
  125. package/src/components/CalendarPage/formParts/discount.tsx +0 -69
  126. package/src/components/CalendarPage/formParts/form_types.d.ts +0 -38
  127. package/src/components/CalendarPage/formParts/insurances.tsx +0 -62
  128. package/src/components/CalendarPage/formParts/radioButtons.tsx +0 -66
  129. package/src/components/Error/ApiError.tsx +0 -33
  130. package/src/components/Error/IntegrationError.tsx +0 -62
  131. package/src/components/Error/index.ts +0 -4
  132. package/src/components/ErrorBoundary.tsx +0 -34
  133. package/src/components/Modal/index.tsx +0 -46
  134. package/src/components/ReviewsPage/Queries.ts +0 -26
  135. package/src/components/ReviewsPage/ReviewsPage.tsx +0 -45
  136. package/src/components/ReviewsPage/Score.tsx +0 -29
  137. package/src/components/ReviewsPage/SingleReview.tsx +0 -38
  138. package/src/components/ReviewsPage/note.tsx +0 -17
  139. package/src/components/SafeBooking.tsx +0 -96
  140. package/src/components/SearchPage/Field.tsx +0 -75
  141. package/src/components/SearchPage/Filters.tsx +0 -91
  142. package/src/components/SearchPage/Paginator.tsx +0 -63
  143. package/src/components/SearchPage/Results.tsx +0 -129
  144. package/src/components/SearchPage/SearchPage.tsx +0 -115
  145. package/src/components/SearchPage/SingleResult.tsx +0 -93
  146. package/src/components/SearchPage/filters/Categories.tsx +0 -57
  147. package/src/components/SearchPage/filters/DateFilter.tsx +0 -34
  148. package/src/components/SearchPage/filters/List.tsx +0 -80
  149. package/src/components/SearchPage/filters/NumberFilter.tsx +0 -37
  150. package/src/components/SearchPage/filters/Radio.tsx +0 -46
  151. package/src/components/SearchPage/filters/Select.tsx +0 -85
  152. package/src/components/SearchPage/filters/__tests__/helper.spec.js +0 -13
  153. package/src/components/SearchPage/filters/filter_types.d.ts +0 -25
  154. package/src/components/SearchPage/filters/helper.ts +0 -19
  155. package/src/components/icons/ArrowLeft.svg.tsx +0 -20
  156. package/src/components/icons/ArrowRight.svg.tsx +0 -16
  157. package/src/components/icons/Reload.svg.tsx +0 -23
  158. package/src/components/icons/info.svg.tsx +0 -24
  159. package/src/components/icons/loading.svg.tsx +0 -98
  160. package/src/custom.d.ts +0 -10
  161. package/src/index.tsx +0 -104
  162. package/src/locales/de.json +0 -137
  163. package/src/locales/en.json +0 -137
  164. package/src/locales/es.json +0 -132
  165. package/src/locales/fr.json +0 -132
  166. package/src/locales/it.json +0 -128
  167. package/src/locales/nl.json +0 -138
  168. package/src/styles/calendar.css +0 -317
  169. package/src/styles/datepicker.css +0 -6
  170. package/src/styles/field.css +0 -105
  171. package/src/styles/filters.css +0 -92
  172. package/src/styles/form.css +0 -219
  173. package/src/styles/main.css +0 -80
  174. package/src/styles/modal.css +0 -79
  175. package/src/styles/pagination.css +0 -92
  176. package/src/styles/price-overview.css +0 -111
  177. package/src/styles/result.css +0 -142
  178. package/src/styles/results.css +0 -50
  179. package/src/styles/reviews.css +0 -90
  180. package/src/styles/success.css +0 -9
  181. package/src/types.d.ts +0 -91
  182. package/tmp/cache/vite/last-build-production.json +0 -7
  183. package/tsconfig.json +0 -17
  184. package/vite.config.ts +0 -31
@@ -1,80 +0,0 @@
1
- import React from 'react';
2
- import { Field, FiltersType, OptionsType } from './filter_types';
3
-
4
- interface Props {
5
- field: Field;
6
- options: OptionsType[];
7
- filters: FiltersType;
8
- value: string;
9
- onChange: Function;
10
- }
11
-
12
- export default function List({
13
- filters,
14
- field,
15
- options,
16
- onChange,
17
- value
18
- }: Props): JSX.Element {
19
- const countries = filters.countries;
20
-
21
- const updateList = (e: { target: { value: string } }) => {
22
- if (value === e.target.value) {
23
- handleChange(null);
24
- } else {
25
- handleChange(e.target.value);
26
- }
27
- };
28
-
29
- const handleChange = ( value: string ) => {
30
- onChange(field.id, value)
31
- }
32
-
33
- if (['cities', 'regions'].includes(field.id)) {
34
- return (
35
- <ul className="radioList">
36
- {options.map((opt) => (
37
- <li
38
- key={opt.id}
39
- className={`bu-list-item ${
40
- countries && !countries.includes(opt.country_id)
41
- ? 'bu-disabled'
42
- : 'bu-open'
43
- }`}
44
- >
45
- <input
46
- name={field.id}
47
- type="checkbox"
48
- id={opt.id}
49
- value={opt.id}
50
- disabled={countries ? !countries.includes(opt.country_id) : false}
51
- checked={value === opt.id}
52
- onBlur={handleChange}
53
- onChange={handleChange}
54
- />
55
- <label htmlFor={opt.id}>{opt.name}</label>
56
- </li>
57
- ))}
58
- </ul>
59
- );
60
- } else {
61
- return (
62
- <ul className="radioList">
63
- {options.map((opt) => (
64
- <li key={opt.id} className={`bu-list-item bu-open`}>
65
- <input
66
- name={field.id}
67
- type="checkbox"
68
- id={opt.id}
69
- value={opt.id}
70
- checked={value === opt.id}
71
- onBlur={handleChange}
72
- onChange={updateList}
73
- />
74
- <label htmlFor={opt.id}>{opt.name}</label>
75
- </li>
76
- ))}
77
- </ul>
78
- );
79
- }
80
- }
@@ -1,37 +0,0 @@
1
- import React, { SyntheticEvent } from 'react';
2
- import { PortalSiteType } from '../../../types';
3
- import { Field } from './filter_types';
4
-
5
- interface Props {
6
- PortalSite: PortalSiteType;
7
- field: Field;
8
- value: string;
9
- onChange: Function;
10
- }
11
-
12
- function NumberFilter({
13
- PortalSite,
14
- field,
15
- value,
16
- onChange
17
- }: Props): JSX.Element {
18
- const handleChange = (event: SyntheticEvent<any>) => {
19
- onChange(field.id, event.currentTarget.value);
20
- };
21
-
22
- return (
23
- <input
24
- value={value}
25
- type="number"
26
- min="0"
27
- max={
28
- field.id === 'persons_min'
29
- ? PortalSite.max_persons
30
- : PortalSite[field.id]
31
- }
32
- onBlur={handleChange}
33
- />
34
- );
35
- }
36
-
37
- export default NumberFilter
@@ -1,46 +0,0 @@
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;
@@ -1,85 +0,0 @@
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;
@@ -1,13 +0,0 @@
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
- });
@@ -1,25 +0,0 @@
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
- };
@@ -1,19 +0,0 @@
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
- ];
@@ -1,20 +0,0 @@
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;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
-
3
- const ArrowRight = () => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- data-name="Layer 1"
7
- viewBox="0 0 100 100"
8
- x="0px"
9
- y="0px"
10
- >
11
- <title>Forward</title>
12
- <path d="M97.64,44.1,64.72,11.18a8.06,8.06,0,1,0-11.4,11.39L72.78,42H8.06a8.06,8.06,0,0,0,0,16.12H72.6L53.32,77.43a8.06,8.06,0,0,0,11.4,11.39L97.64,55.9A8,8,0,0,0,100,50.2a1.27,1.27,0,0,0,0-.2,1.41,1.41,0,0,0,0-.2A8.07,8.07,0,0,0,97.64,44.1Z" />
13
- </svg>
14
- );
15
-
16
- export default ArrowRight;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
-
3
- const Reload = () => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- xmlnsXlink="http://www.w3.org/1999/xlink"
7
- version="1.1"
8
- x="0px"
9
- y="0px"
10
- viewBox="0 0 100 100"
11
- enableBackground="new 0 0 100 100"
12
- xmlSpace="preserve"
13
- height="16px"
14
- >
15
- <path
16
- fill="#000000"
17
- stroke="2"
18
- d="M77,53.752c0,0.012,0,0.022,0,0.034c0,14.92-12.019,27.058-26.938,27.058 c-14.92,0-26.948-12.138-26.948-27.058C23.114,38.961,35,26.889,50,26.738v4.942c0,2.84,2.54,2.913,3.947,1.647l10.354-7.714 c0,0,1.128-0.942,1.128-1.979c0-1.089-1.147-1.979-1.147-1.979L53.95,13.941C52.543,12.675,50,12.749,50,15.588v5.149 c-18,0.151-32.826,14.915-32.826,33.048c0,18.229,14.686,33.058,32.914,33.058C68.314,86.844,83,72.015,83,53.786 c0-0.012,0-0.022,0-0.034c0,0,0-3.375-3.037-3.375C77.109,50.376,77,53.752,77,53.752z"
19
- />
20
- </svg>
21
- );
22
-
23
- export default Reload;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
-
3
- const Icon = ({ height = '16px', width = '16px' }) => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- xmlnsXlink="http://www.w3.org/1999/xlink"
7
- version="1.1"
8
- x="0px"
9
- y="0px"
10
- viewBox="0 0 100 100"
11
- enableBackground="new 0 0 100 100"
12
- xmlSpace="preserve"
13
- style={{
14
- height,
15
- width,
16
- }}
17
- >
18
- <path d="M50,5c24.813,0,45,20.187,45,45c0,24.813-20.187,45-45,45C25.187,95,5,74.813,5,50C5,25.187,25.187,5,50,5 M50,0C22.386,0,0,22.386,0,50c0,27.614,22.386,50,50,50c27.614,0,50-22.386,50-50C100,22.386,77.614,0,50,0L50,0z" />
19
- <circle cx="50" cy="29.546" r="4.934" />
20
- <rect x="46.5" y="41.21" width="7" height="34.179" />
21
- </svg>
22
- );
23
-
24
- export default Icon;
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
-
3
- const Loading = () => (
4
- <svg
5
- version="1.1"
6
- id="Layer_1"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlnsXlink="http://www.w3.org/1999/xlink"
9
- x="0px"
10
- y="0px"
11
- width="24px"
12
- height="30px"
13
- viewBox="0 0 24 30"
14
- enableBackground="new 0 0 50 50"
15
- xmlSpace="preserve"
16
- >
17
- <rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2">
18
- <animate
19
- attributeName="opacity"
20
- attributeType="XML"
21
- values="0.2; 1; .2"
22
- begin="0s"
23
- dur="0.6s"
24
- repeatCount="indefinite"
25
- />
26
- <animate
27
- attributeName="height"
28
- attributeType="XML"
29
- values="10; 20; 10"
30
- begin="0s"
31
- dur="0.6s"
32
- repeatCount="indefinite"
33
- />
34
- <animate
35
- attributeName="y"
36
- attributeType="XML"
37
- values="10; 5; 10"
38
- begin="0s"
39
- dur="0.6s"
40
- repeatCount="indefinite"
41
- />
42
- </rect>
43
- <rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2">
44
- <animate
45
- attributeName="opacity"
46
- attributeType="XML"
47
- values="0.2; 1; .2"
48
- begin="0.15s"
49
- dur="0.6s"
50
- repeatCount="indefinite"
51
- />
52
- <animate
53
- attributeName="height"
54
- attributeType="XML"
55
- values="10; 20; 10"
56
- begin="0.15s"
57
- dur="0.6s"
58
- repeatCount="indefinite"
59
- />
60
- <animate
61
- attributeName="y"
62
- attributeType="XML"
63
- values="10; 5; 10"
64
- begin="0.15s"
65
- dur="0.6s"
66
- repeatCount="indefinite"
67
- />
68
- </rect>
69
- <rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2">
70
- <animate
71
- attributeName="opacity"
72
- attributeType="XML"
73
- values="0.2; 1; .2"
74
- begin="0.3s"
75
- dur="0.6s"
76
- repeatCount="indefinite"
77
- />
78
- <animate
79
- attributeName="height"
80
- attributeType="XML"
81
- values="10; 20; 10"
82
- begin="0.3s"
83
- dur="0.6s"
84
- repeatCount="indefinite"
85
- />
86
- <animate
87
- attributeName="y"
88
- attributeType="XML"
89
- values="10; 5; 10"
90
- begin="0.3s"
91
- dur="0.6s"
92
- repeatCount="indefinite"
93
- />
94
- </rect>
95
- </svg>
96
- );
97
-
98
- export default Loading;
package/src/custom.d.ts DELETED
@@ -1,10 +0,0 @@
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 DELETED
@@ -1,104 +0,0 @@
1
- import React, { useEffect, useRef, useState } 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 [width, setWidth] = useState(0);
48
- const ref = useRef();
49
-
50
- useEffect(() => {
51
- if (ref.current) {
52
- setWidth(ref.current.getBoundingClientRect().width);
53
- }
54
- }, [ref.current]);
55
-
56
- const client = new ApolloClient({
57
- uri: api_url,
58
- cache: new InMemoryCache(),
59
- headers: {
60
- locale
61
- },
62
- defaultOptions: {
63
- watchQuery: {
64
- fetchPolicy: 'cache-and-network'
65
- }
66
- }
67
- });
68
-
69
- const messages: MessagesType = { en, nl, de, fr, es, it };
70
-
71
- window.__localeId__ = locale;
72
-
73
- return (
74
- <ApolloProvider client={client}>
75
- <IntlProvider locale={locale} messages={messages[locale]}>
76
- <AppContext.Provider value={{ portalCode, objectCode, locale }}>
77
- <div ref={ref} className={width < 875 ? 'bu-smaller' : 'bu-large'}>
78
- <App pageType={pageType} locale={locale} filters={filters} />
79
- </div>
80
- </AppContext.Provider>
81
- </IntlProvider>
82
- </ApolloProvider>
83
- );
84
- }
85
-
86
- Portal.defaultProps = {
87
- pageType: null,
88
- api_url: 'https://api.bukazu.com/graphql'
89
- };
90
-
91
- export default Portal;
92
-
93
- type MessagesType = {
94
- en: JSONType;
95
- nl: JSONType;
96
- de: JSONType;
97
- fr: JSONType;
98
- es: JSONType;
99
- it: JSONType;
100
- };
101
-
102
- type JSONType = {
103
- [key: string]: string;
104
- };