@abcagency/hc-ui-components 1.3.22 → 1.3.23

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 (174) hide show
  1. package/package.json +4 -1
  2. package/.env +0 -3
  3. package/.eslintrc +0 -136
  4. package/bundleDist/bundle.js +0 -28145
  5. package/bundleDist/bundle.js.map +0 -1
  6. package/bundleDist/dist/styles/index.css +0 -3
  7. package/bundleDist/dist/types/apis/hcApi.d.ts +0 -5
  8. package/bundleDist/dist/types/clientToken.d.ts +0 -2
  9. package/bundleDist/dist/types/components/containers/accordions/map-accordion-item-container.d.ts +0 -12
  10. package/bundleDist/dist/types/components/containers/jobListing/listing-details-container.d.ts +0 -6
  11. package/bundleDist/dist/types/components/containers/list/item-list-container.d.ts +0 -9
  12. package/bundleDist/dist/types/components/containers/list/list-item/list-item-container.d.ts +0 -14
  13. package/bundleDist/dist/types/components/modules/accordions/MapAccordionItem.d.ts +0 -10
  14. package/bundleDist/dist/types/components/modules/accordions/default.d.ts +0 -19
  15. package/bundleDist/dist/types/components/modules/buttons/button-group-apply.d.ts +0 -24
  16. package/bundleDist/dist/types/components/modules/buttons/commute-pill.d.ts +0 -5
  17. package/bundleDist/dist/types/components/modules/buttons/default.d.ts +0 -48
  18. package/bundleDist/dist/types/components/modules/buttons/pill-wrapper.d.ts +0 -3
  19. package/bundleDist/dist/types/components/modules/dialogs/apply-dialog.d.ts +0 -8
  20. package/bundleDist/dist/types/components/modules/filter/sort.d.ts +0 -8
  21. package/bundleDist/dist/types/components/modules/grid.d.ts +0 -8
  22. package/bundleDist/dist/types/components/modules/icon.d.ts +0 -10
  23. package/bundleDist/dist/types/components/modules/jobListing/listing-details.d.ts +0 -18
  24. package/bundleDist/dist/types/components/modules/list/field-mapper.d.ts +0 -10
  25. package/bundleDist/dist/types/components/modules/list/header-item.d.ts +0 -11
  26. package/bundleDist/dist/types/components/modules/list/header.d.ts +0 -11
  27. package/bundleDist/dist/types/components/modules/list/item-expand-card/index.d.ts +0 -7
  28. package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +0 -17
  29. package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +0 -21
  30. package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +0 -8
  31. package/bundleDist/dist/types/components/modules/list/item-list.d.ts +0 -20
  32. package/bundleDist/dist/types/components/modules/list/list-item/list-item.d.ts +0 -3
  33. package/bundleDist/dist/types/constants/eventTypes.d.ts +0 -13
  34. package/bundleDist/dist/types/contexts/mapContext.d.ts +0 -29
  35. package/bundleDist/dist/types/contexts/mapListContext.d.ts +0 -59
  36. package/bundleDist/dist/types/contexts/trackEventContext.d.ts +0 -6
  37. package/bundleDist/dist/types/enums/SectionType.d.ts +0 -9
  38. package/bundleDist/dist/types/hooks/useList.d.ts +0 -13
  39. package/bundleDist/dist/types/services/configService.d.ts +0 -6
  40. package/bundleDist/dist/types/services/googlePlacesNearbyService.d.ts +0 -5
  41. package/bundleDist/dist/types/services/listingAggregatorService.d.ts +0 -12
  42. package/bundleDist/dist/types/services/listingEntityService.d.ts +0 -6
  43. package/bundleDist/dist/types/services/listingService.d.ts +0 -9
  44. package/bundleDist/dist/types/services/recruiterService.d.ts +0 -6
  45. package/bundleDist/dist/types/types/Address.d.ts +0 -7
  46. package/bundleDist/dist/types/types/ContentSection.d.ts +0 -8
  47. package/bundleDist/dist/types/types/GetListingParams.d.ts +0 -8
  48. package/bundleDist/dist/types/types/LatLng.d.ts +0 -4
  49. package/bundleDist/dist/types/types/ListingEntity.d.ts +0 -10
  50. package/bundleDist/dist/types/types/ListingFields.d.ts +0 -25
  51. package/bundleDist/dist/types/types/Listings.d.ts +0 -31
  52. package/bundleDist/dist/types/types/Recruiter.d.ts +0 -9
  53. package/bundleDist/dist/types/types/SimilarListing.d.ts +0 -24
  54. package/bundleDist/dist/types/types/config/Colors.d.ts +0 -8
  55. package/bundleDist/dist/types/types/config/MapConfig.d.ts +0 -30
  56. package/bundleDist/dist/types/types/config/PointsOfInterestConfig.d.ts +0 -13
  57. package/bundleDist/dist/types/types/config/SearchConfig.d.ts +0 -4
  58. package/bundleDist/dist/types/util/filterUtil.d.ts +0 -28
  59. package/bundleDist/dist/types/util/loading.d.ts +0 -3
  60. package/bundleDist/dist/types/util/localStorageUtil.d.ts +0 -3
  61. package/bundleDist/dist/types/util/mapUtil.d.ts +0 -15
  62. package/bundleDist/dist/types/util/sortUtil.d.ts +0 -1
  63. package/bundleDist/dist/types/util/stringUtils.d.ts +0 -1
  64. package/bundleDist/dist/types/util/urlFilterUtil.d.ts +0 -8
  65. package/bundleDist/styles/index.css +0 -3
  66. package/bundleDist.map +0 -1
  67. package/jsconfig.json +0 -7
  68. package/postcss.config.js +0 -14
  69. package/preset.default.js +0 -15
  70. package/rollup.config.mjs +0 -111
  71. package/src/.editorconfig +0 -12
  72. package/src/apis/hcApi.ts +0 -109
  73. package/src/bundleIndex.js +0 -14
  74. package/src/clientToken.js +0 -9
  75. package/src/components/HireControlMap.js +0 -135
  76. package/src/components/containers/accordions/filter-container.js +0 -48
  77. package/src/components/containers/accordions/filter-item-container.js +0 -66
  78. package/src/components/containers/accordions/map-accordion-item-container.js +0 -70
  79. package/src/components/containers/filter/commute-container.js +0 -89
  80. package/src/components/containers/filter/filter-container.js +0 -76
  81. package/src/components/containers/filter/filter-item-container.js +0 -71
  82. package/src/components/containers/filter/location-container.js +0 -45
  83. package/src/components/containers/filter/points-of-interest-container.js +0 -33
  84. package/src/components/containers/filter/points-of-interest-radio-item-container.js +0 -35
  85. package/src/components/containers/filter/search-container.js +0 -50
  86. package/src/components/containers/jobListing/listing-details-container.js +0 -40
  87. package/src/components/containers/list/item-list-container.tsx +0 -81
  88. package/src/components/containers/list/list-item/list-item-container.js +0 -43
  89. package/src/components/containers/maps/info-window-content-container.js +0 -51
  90. package/src/components/containers/maps/map-container.js +0 -204
  91. package/src/components/containers/maps/map-list-container.js +0 -48
  92. package/src/components/containers/maps/map-marker-container.js +0 -78
  93. package/src/components/modules/accordions/MapAccordionItem.js +0 -30
  94. package/src/components/modules/accordions/default.js +0 -171
  95. package/src/components/modules/accordions/filterItem.js +0 -27
  96. package/src/components/modules/accordions/filters.js +0 -32
  97. package/src/components/modules/buttons/button-group-apply.js +0 -123
  98. package/src/components/modules/buttons/commute-pill.js +0 -22
  99. package/src/components/modules/buttons/default.js +0 -194
  100. package/src/components/modules/buttons/items-pill.js +0 -35
  101. package/src/components/modules/buttons/pill-wrapper.js +0 -27
  102. package/src/components/modules/buttons/show-all-button.js +0 -20
  103. package/src/components/modules/cards/default.js +0 -167
  104. package/src/components/modules/cards/filter.js +0 -56
  105. package/src/components/modules/dialogs/apply-dialog.js +0 -48
  106. package/src/components/modules/filter/commute.js +0 -108
  107. package/src/components/modules/filter/index.js +0 -55
  108. package/src/components/modules/filter/item.js +0 -48
  109. package/src/components/modules/filter/location.js +0 -48
  110. package/src/components/modules/filter/radio-item.js +0 -42
  111. package/src/components/modules/filter/search.js +0 -65
  112. package/src/components/modules/filter/sort.js +0 -83
  113. package/src/components/modules/grid.js +0 -54
  114. package/src/components/modules/icon.js +0 -33
  115. package/src/components/modules/jobListing/listing-details.js +0 -109
  116. package/src/components/modules/list/field-mapper.js +0 -114
  117. package/src/components/modules/list/header-item.js +0 -91
  118. package/src/components/modules/list/header.js +0 -49
  119. package/src/components/modules/list/item-expand-card/index.js +0 -22
  120. package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +0 -50
  121. package/src/components/modules/list/item-expand-card/recruiter-details.js +0 -68
  122. package/src/components/modules/list/item-expand-card/recruiter-headshot.js +0 -22
  123. package/src/components/modules/list/item-list.tsx +0 -84
  124. package/src/components/modules/list/list-item/list-item.js +0 -130
  125. package/src/components/modules/maps/info-window-card.js +0 -17
  126. package/src/components/modules/maps/info-window-content.js +0 -35
  127. package/src/components/modules/maps/map-list.js +0 -28
  128. package/src/components/modules/maps/map-marker.js +0 -29
  129. package/src/components/modules/maps/map.js +0 -76
  130. package/src/components/modules/maps/place-marker.js +0 -41
  131. package/src/components/modules/maps/tabs.js +0 -81
  132. package/src/constants/eventTypes.js +0 -13
  133. package/src/constants/placeTypes.js +0 -8
  134. package/src/contexts/mapContext.tsx +0 -129
  135. package/src/contexts/mapListContext.tsx +0 -311
  136. package/src/contexts/placesContext.js +0 -102
  137. package/src/contexts/trackEventContext.js +0 -14
  138. package/src/enums/SectionType.ts +0 -9
  139. package/src/hooks/useList.js +0 -89
  140. package/src/index.js +0 -3
  141. package/src/services/configService.ts +0 -16
  142. package/src/services/googlePlacesNearbyService.ts +0 -42
  143. package/src/services/listingAggregatorService.ts +0 -76
  144. package/src/services/listingEntityService.ts +0 -16
  145. package/src/services/listingService.ts +0 -40
  146. package/src/services/recruiterService.ts +0 -18
  147. package/src/styles/bundle.css +0 -268
  148. package/src/styles/index.css +0 -24
  149. package/src/types/Address.ts +0 -7
  150. package/src/types/ContentSection.ts +0 -9
  151. package/src/types/GetListingParams.ts +0 -8
  152. package/src/types/LatLng.ts +0 -4
  153. package/src/types/ListingEntity.ts +0 -11
  154. package/src/types/ListingFields.ts +0 -25
  155. package/src/types/Listings.ts +0 -32
  156. package/src/types/Recruiter.ts +0 -9
  157. package/src/types/SimilarListing.ts +0 -24
  158. package/src/types/config/Colors.ts +0 -8
  159. package/src/types/config/MapConfig.ts +0 -31
  160. package/src/types/config/PointsOfInterestConfig.ts +0 -13
  161. package/src/types/config/SearchConfig.ts +0 -4
  162. package/src/util/arrayUtil.js +0 -3
  163. package/src/util/fieldMapper.js +0 -22
  164. package/src/util/filterUtil.js +0 -239
  165. package/src/util/loading.js +0 -17
  166. package/src/util/localStorageUtil.ts +0 -34
  167. package/src/util/mapIconUtil.js +0 -180
  168. package/src/util/mapUtil.js +0 -91
  169. package/src/util/sortUtil.js +0 -33
  170. package/src/util/stringUtils.js +0 -6
  171. package/src/util/urlFilterUtil.js +0 -85
  172. package/stats.html +0 -4842
  173. package/tailwind.config.js +0 -129
  174. package/tsconfig.json +0 -23
@@ -1,89 +0,0 @@
1
- import React, { useRef, useState, useEffect } from 'react';
2
- import usePlacesAutocomplete, { getGeocode, getLatLng } from 'use-places-autocomplete';
3
-
4
- import { useMapList } from '~/contexts/mapListContext';
5
- import { useTrackEvent } from '~/contexts/trackEventContext';
6
- import { getStorageItem } from '~/util/localStorageUtil';
7
- import FilterCommute from '~/components/modules/filter/commute';
8
-
9
- const FilterCommuteContainer = ({ className }) => {
10
- const {
11
- ready,
12
- suggestions: { status, data },
13
- setValue,
14
- clearSuggestions
15
- } = usePlacesAutocomplete();
16
-
17
- const [selected, setSelected] = useState(getStorageItem('selectedCommute', ''));
18
- const inputRef = useRef(null);
19
- const { setCommuteLocation, commuteLocation } = useMapList();
20
- const [isCurrentLocation, setIsCurrentLocation] = useState(getStorageItem('isCurrentLocation', false));
21
- const { trackEvent, eventTypes } = useTrackEvent();
22
-
23
- useEffect(() => {
24
- if (commuteLocation !== null && commuteLocation !== '') return;
25
- setIsCurrentLocation(false);
26
- localStorage.removeItem('isCurrentLocation');
27
- localStorage.removeItem('selectedCommute');
28
- setSelected("");
29
- }, [commuteLocation]);
30
-
31
- const handleSelect = async (val, isCurrLocation = false) => {
32
- setValue(val, false);
33
- setSelected(val);
34
- localStorage.setItem('selectedCommute', val);
35
- clearSuggestions();
36
- if (isCurrLocation) return;
37
- try {
38
- const results = await getGeocode({ address: val });
39
- const { lat, lng } = await getLatLng(results[0]);
40
- trackEvent(eventTypes.COMMUTE_ORIGIN_ADDED, { commuteLocation: { lat, lng }, isCurrentLocation: false });
41
- setCommuteLocation({ lat, lng });
42
- } catch (error) {
43
- // no-op
44
- }
45
- };
46
-
47
- const fetchLocation = () => {
48
- if (!navigator.geolocation) {
49
- console.error("Geolocation is not supported by this browser.");
50
- return;
51
- }
52
- navigator.geolocation.getCurrentPosition(
53
- position => {
54
- const location = {
55
- lat: position.coords.latitude,
56
- lng: position.coords.longitude
57
- };
58
- setCommuteLocation(location);
59
- trackEvent(eventTypes.COMMUTE_ORIGIN_ADDED, { commuteLocation: location, isCurrentLocation: true });
60
- handleSelect("Current Location");
61
- },
62
- error => {
63
- console.error("Error fetching location", error);
64
- }
65
- );
66
- };
67
-
68
- return (
69
- <FilterCommute
70
- className={className}
71
- ready={ready}
72
- status={status}
73
- data={data}
74
- selected={selected}
75
- isCurrentLocation={isCurrentLocation}
76
- inputRef={inputRef}
77
- handleSelect={handleSelect}
78
- setValue={setValue}
79
- setSelected={setSelected}
80
- clearSuggestions={clearSuggestions}
81
- commuteLocation={commuteLocation}
82
- setIsCurrentLocation={setIsCurrentLocation}
83
- fetchLocation={fetchLocation}
84
- setCommuteLocation={setCommuteLocation}
85
- />
86
- );
87
- };
88
-
89
- export default FilterCommuteContainer;
@@ -1,76 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useMap } from '~/contexts/mapContext';
3
- import { useMapList } from '~/contexts/mapListContext';
4
- import { useTrackEvent } from '~/contexts/trackEventContext';
5
- import Filter from '~/components/modules/filter/index';
6
- import FilterSearch from '~/components/containers/filter/search-container';
7
- import FiltersAccordion from '~/components/containers/accordions/filter-container';
8
- import FilterLocations from '~/components/containers/filter/location-container';
9
-
10
- const FilterContainer = ({
11
- className,
12
- showMap
13
- }) => {
14
- const { trackEvent, eventTypes } = useTrackEvent();
15
- const [hasActiveFilters, setHasActiveFilters] = useState(false);
16
- const [defaultValue, setDefaultValue] = useState(null);
17
- const { setSelectedListItem, setLocation, filterReset } = useMap();
18
- const {
19
- filteredListings,
20
- selectedFilters,
21
- setSelectedFilters,
22
- setMobileTab,
23
- handleSettingFavorites,
24
- setQuery,
25
- siteConfig
26
- } = useMapList();
27
-
28
- const handleReset = () => {
29
- trackEvent(eventTypes.FILTERS_RESET, { filtersRemoved: selectedFilters });
30
- filterReset();
31
- setSelectedFilters({});
32
- setQuery(null);
33
- handleSettingFavorites(null);
34
- };
35
-
36
- return (
37
- <Filter
38
- className={className}
39
- showMap={showMap}
40
- hasActiveFilters={hasActiveFilters}
41
- setHasActiveFilters={setHasActiveFilters}
42
- defaultValue={defaultValue}
43
- setDefaultValue={setDefaultValue}
44
- setSelectedListItem={setSelectedListItem}
45
- setLocation={setLocation}
46
- filteredListings={filteredListings}
47
- selectedFilters={selectedFilters}
48
- setSelectedFilters={setSelectedFilters}
49
- setMobileTab={setMobileTab}
50
- handleReset={handleReset}
51
- siteConfig={siteConfig}
52
- >
53
- <FiltersAccordion
54
- setHasActiveFilters={setHasActiveFilters}
55
- defaultValue={defaultValue}
56
- setDefaultValue={value => { setDefaultValue(value === defaultValue ? "" : value); }}
57
- setLocation={setLocation}
58
- setSelectedListItem={setSelectedListItem}
59
- SubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}
60
- />
61
- <FilterSearch />
62
- {siteConfig.hideLocations !== true &&
63
- <FilterLocations
64
- setHasActiveFilters={setHasActiveFilters}
65
- defaultValue={defaultValue}
66
- showMap={showMap}
67
- setDefaultValue={value => { setDefaultValue(value === defaultValue ? "" : value); }}
68
- setLocation={setLocation}
69
- setSelectedListItem={setSelectedListItem}
70
- />
71
- }
72
- </Filter>
73
- );
74
- };
75
-
76
- export default FilterContainer;
@@ -1,71 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { useTrackEvent } from '~/contexts/trackEventContext';
3
- import FilterItem from '~/components/modules/filter/item';
4
-
5
- const FilterItemContainer = ({
6
- className,
7
- item,
8
- type = 'checkbox',
9
- itemKey = null,
10
- hasCount = true,
11
- field,
12
- selectedFilters,
13
- setSelectedFilters,
14
- ...rest
15
- }) => {
16
- const { trackEvent, eventTypes } = useTrackEvent();
17
- const itemName = item.name ? item.name : item;
18
- itemKey = itemKey === null ? itemName : itemKey;
19
- const isActive = selectedFilters != undefined && !!selectedFilters[field]?.[itemKey];
20
- const [activeItem, setActiveItem] = useState(isActive);
21
-
22
- useEffect(() => {
23
- if (!selectedFilters) return;
24
- setActiveItem(!!selectedFilters[field]?.[itemKey]);
25
- }, [selectedFilters, field, itemKey]);
26
-
27
- const changeHandler = () => {
28
- if (!isActive) {
29
- trackEvent(eventTypes.FILTER_APPLIED, { filterType: field, filterChecked: itemKey });
30
- }
31
- setSelectedFilters(prevFilters => {
32
- const updatedFilters = { ...prevFilters };
33
- if (!isActive) {
34
- if (!updatedFilters[field]) {
35
- updatedFilters[field] = {};
36
- }
37
- updatedFilters[field][itemKey] = true;
38
- return updatedFilters;
39
- }
40
- delete updatedFilters[field][itemKey];
41
- if (Object.keys(updatedFilters[field]).length === 0) {
42
- delete updatedFilters[field];
43
- }
44
- return updatedFilters;
45
- });
46
- };
47
-
48
- useEffect(() => {
49
- if (selectedFilters && selectedFilters[field] && Object.keys(selectedFilters[field])?.length > 0) return;
50
- else if (activeItem === true) {
51
- setActiveItem(false);
52
- }
53
- }, [selectedFilters]);
54
-
55
- return (
56
- <FilterItem
57
- className={className}
58
- item={item}
59
- type={type}
60
- itemKey={itemKey}
61
- hasCount={hasCount}
62
- field={field}
63
- activeItem={activeItem}
64
- setActiveItem={setActiveItem}
65
- changeHandler={changeHandler}
66
- {...rest}
67
- />
68
- );
69
- };
70
-
71
- export default FilterItemContainer;
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import FilterLocation from '~/components/modules/filter/location';
3
- import FilterCommute from '~/components/containers/filter/commute-container';
4
- import FilterPointsOfInterest from '~/components/containers/filter/points-of-interest-container';
5
- import { useMapList } from '~/contexts/mapListContext';
6
-
7
- const FilterLocationContainer = ({
8
- className,
9
- defaultValue,
10
- setDefaultValue,
11
- showMap = false,
12
- setLocation,
13
- setSelectedListItem
14
- }) => {
15
- const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
16
-
17
- const locations = filterOptions?.locations;
18
- const pointsOfInterest = filterOptions?.pointsOfInterest;
19
-
20
- return (
21
- <FilterLocation
22
- className={className}
23
- defaultValue={defaultValue}
24
- setDefaultValue={setDefaultValue}
25
- showMap={showMap}
26
- setLocation={setLocation}
27
- setSelectedListItem={setSelectedListItem}
28
- locations={locations}
29
- setSelectedFilters={setSelectedFilters}
30
- selectedFilters={selectedFilters}
31
- >
32
- {showMap && <FilterCommute className="hc-mt-6" />}
33
- {showMap && (
34
- <FilterPointsOfInterest
35
- className="hc-mt-4"
36
- pointsOfInterest={pointsOfInterest}
37
- setDefaultValue={setDefaultValue}
38
- defaultValue={defaultValue}
39
- />
40
- )}
41
- </FilterLocation>
42
- );
43
- };
44
-
45
- export default FilterLocationContainer;
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import Accordion from '~/components/modules/accordions/default';
3
- import AccordionFilterItem from '~/components/modules/accordions/filterItem';
4
- import RadioItemContainer from '~/components/containers/filter/points-of-interest-radio-item-container';
5
-
6
- const FilterPointsOfInterestContainer = ({
7
- title = "Points of interest",
8
- pointsOfInterest,
9
- setDefaultValue,
10
- className,
11
- defaultValue
12
- }) => {
13
- const renderRadioItem = (item, index) => (
14
- <RadioItemContainer key={item.key + index} item={item} field={item.id} />
15
- );
16
-
17
- const body = pointsOfInterest.items.map((item, index) => renderRadioItem(item, index));
18
-
19
- return (
20
- <div className={`hc-relative ${className ?? ""}`}>
21
- <Accordion defaultValue={defaultValue} className="hc-space-y-4">
22
- <AccordionFilterItem
23
- id="points-of-interest"
24
- setDefaultValue={setDefaultValue}
25
- header={title}
26
- body={body}
27
- />
28
- </Accordion>
29
- </div>
30
- );
31
- };
32
-
33
- export default FilterPointsOfInterestContainer;
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import RadioItem from '~/components/modules/filter/radio-item';
3
- import { useMap } from '~/contexts/mapContext';
4
- import { useTrackEvent } from '~/contexts/trackEventContext';
5
-
6
- const RadioItemContainer = ({
7
- className,
8
- item,
9
- field,
10
- ...rest
11
- }) => {
12
- const { trackEvent, eventTypes } = useTrackEvent();
13
- const { selectedPlaces, setSelectedPlaces } = useMap();
14
- const chosenPlace = item.key.toLowerCase();
15
- const isActive = selectedPlaces.includes(chosenPlace);
16
-
17
- const changeHandler = () => {
18
- if (!isActive)
19
- trackEvent(eventTypes.POI_APPLIED, { chosenPlace });
20
- setSelectedPlaces([isActive ? '' : chosenPlace]);
21
- };
22
-
23
- return (
24
- <RadioItem
25
- className={className}
26
- item={item}
27
- field={field}
28
- isActive={isActive}
29
- changeHandler={changeHandler}
30
- {...rest}
31
- />
32
- );
33
- };
34
-
35
- export default RadioItemContainer;
@@ -1,50 +0,0 @@
1
- import React, { useRef, useState, useEffect } from 'react';
2
- import { useMapList } from '~/contexts/mapListContext';
3
- import Search from '~/components/modules/filter/search';
4
-
5
- const SearchContainer = ({
6
- inputPlaceholder = "Keywords",
7
- showSearchIcon = false,
8
- className,
9
- labelClassName
10
- }) => {
11
- const { query, setQuery, siteConfig } = useMapList();
12
- const [inputValue, setInputValue] = useState(query != null ? query : "");
13
- const debounceTimer = useRef(null);
14
-
15
- const handleInputChange = e => {
16
- setInputValue(e.target.value);
17
- if (debounceTimer.current) {
18
- clearTimeout(debounceTimer.current);
19
- }
20
- debounceTimer.current = setTimeout(() => {
21
- setQuery(e.target.value);
22
- }, 500);
23
- };
24
-
25
- const handleReset = () => {
26
- setInputValue("");
27
- setQuery("");
28
- };
29
-
30
- useEffect(() => {
31
- if (query == null) {
32
- setInputValue("");
33
- }
34
- }, [query]);
35
-
36
- return (
37
- <Search
38
- inputPlaceholder={siteConfig.searchConfig.placeholder || inputPlaceholder}
39
- showSearchIcon={showSearchIcon}
40
- className={className}
41
- labelClassName={labelClassName}
42
- inputValue={inputValue}
43
- handleInputChange={handleInputChange}
44
- handleReset={handleReset}
45
- label={siteConfig.searchConfig.label}
46
- />
47
- );
48
- };
49
-
50
- export default SearchContainer;
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { useMap } from '~/contexts/mapContext';
3
- import { useMapList } from '~/contexts/mapListContext';
4
- import { useTrackEvent } from '~/contexts/trackEventContext';
5
- import ListingDetails from '~/components/modules/jobListing/listing-details';
6
-
7
- const ListingDetailsContainer = ({ item, recruiter }) => {
8
- const { trackEvent, eventTypes } = useTrackEvent();
9
- const { travelTime } = useMap();
10
- const { siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat } = useMapList();
11
-
12
- const {
13
- useDetailsPostMessage,
14
- useApplyDialog,
15
- internalApplyLink,
16
- companyName,
17
- jobsDomain
18
- } = siteConfig;
19
-
20
- return (
21
- <ListingDetails
22
- item={item}
23
- recruiter={recruiter}
24
- travelTime={travelTime}
25
- useDetailsPostMessage={useDetailsPostMessage}
26
- navigateToDetails={navigateToDetails}
27
- navigateToEasyApply={navigateToEasyApply}
28
- Link={Link}
29
- linkFormat={linkFormat}
30
- useApplyDialog={useApplyDialog}
31
- internalApplyLink={internalApplyLink}
32
- companyName={companyName}
33
- jobsDomain={jobsDomain}
34
- trackEvent={trackEvent}
35
- eventTypes={eventTypes}
36
- />
37
- );
38
- };
39
-
40
- export default ListingDetailsContainer;
@@ -1,81 +0,0 @@
1
- import React from 'react';
2
- import useListLogic from '~/hooks/useList';
3
- import { useMap } from '~/contexts/mapContext';
4
- import { useMapList } from '~/contexts/mapListContext';
5
- import { useTrackEvent } from '~/contexts/trackEventContext';
6
- import ItemsList from '~/components/modules/list/item-list';
7
- import Accordion from '~/components/modules/accordions/default';
8
- import MapAccordionItemContainer from '~/components/containers/accordions/map-accordion-item-container';
9
- import { dynamicSort } from '~/util/sortUtil';
10
- import { Listing } from '~/types/Listings';
11
- import ListingDetailsContainer from '../jobListing/listing-details-container';
12
-
13
- interface ItemsListContainerProps {
14
- fieldNames: Record<string, string>;
15
- showMap: boolean;
16
- fieldsShown: string[];
17
- specialFeatures: any;
18
- }
19
-
20
- const ItemsListContainer: React.FC<ItemsListContainerProps> = ({
21
- fieldNames,
22
- showMap,
23
- fieldsShown,
24
- specialFeatures
25
- }) => {
26
- const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting } = useMapList();
27
- const { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);
28
- const { selectedListItem } = useMap();
29
- const { trackEvent, eventTypes } = useTrackEvent() as any;
30
- const itemExpandedContent = (item: any, recruiter: any) =>
31
- item ? <ListingDetailsContainer item={item} recruiter={recruiter} /> : null;
32
-
33
- if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
34
- fieldsShown.push('travelTime');
35
- fieldNames['travelTime'] = 'Commute';
36
- } else if (fieldsShown.includes('travelTime') && !commuteLocation) {
37
- fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
38
- }
39
-
40
- const setTrackedSortSetting = (sortSetting: { field: string; type: string }) => {
41
- trackEvent(eventTypes.LIST_SORTED, sortSetting);
42
- setSortSetting(sortSetting);
43
- };
44
- return (
45
- <ItemsList
46
- fieldNames={fieldNames}
47
- showMap={showMap}
48
- fieldsShown={fieldsShown}
49
- filteredListings={filteredListings}
50
- loading={loading}
51
- sortSetting={sortSetting}
52
- setSortSetting={setTrackedSortSetting}
53
- itemLimit={itemLimit}
54
- loader={loader}
55
- scrollContainerRef={scrollContainerRef}
56
- itemRefs={itemRefs}
57
- selectedListItem={selectedListItem}
58
- includeFavorite={true}
59
- >
60
- <Accordion className="hc-divide-y hc-divide-uiAccent/10 hc-z-[1000]" defaultValue={selectedListItem?.id}>
61
- {(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type) : filteredListings)
62
- .slice(0, itemLimit)
63
- .map((item: Listing) => (
64
- <MapAccordionItemContainer
65
- key={item.id}
66
- showMap={showMap}
67
- item={item}
68
- itemRefs={itemRefs}
69
- fieldsShown={fieldsShown}
70
- itemExpandedContent={itemExpandedContent}
71
- specialFeatures={specialFeatures}
72
- isActive={selectedListItem?.id === item.id}
73
- hasListItemSelected={selectedListItem != null}
74
- />
75
- ))}
76
- </Accordion>
77
- </ItemsList>
78
- );
79
- };
80
-
81
- export default ItemsListContainer;
@@ -1,43 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useMapList } from '~/contexts/mapListContext';
3
- import { useTrackEvent } from '~/contexts/trackEventContext';
4
- import ListItem from '~/components/modules/list/list-item/list-item';
5
-
6
- const ListItemContainer = ({
7
- isActive,
8
- showMap,
9
- item,
10
- itemRefs,
11
- fieldsShown,
12
- specialFeatures,
13
- className,
14
- bodyClassName,
15
- onItemSelected,
16
- ...props
17
- }) => {
18
- const { siteConfig, favorites, handleSettingFavorites, setMobileTab } = useMapList();
19
- const { trackEvent, eventTypes } = useTrackEvent();
20
-
21
- return (
22
- <ListItem
23
- isActive={isActive}
24
- showMap={showMap}
25
- item={item}
26
- itemRefs={itemRefs}
27
- fieldsShown={fieldsShown}
28
- specialFeatures={specialFeatures}
29
- className={isActive ? "!hc-border-secondary hc-border hc-border-b-0" : "hc-opacity-85"}
30
- bodyClassName={bodyClassName}
31
- onItemSelected={onItemSelected}
32
- setMobileTab={setMobileTab}
33
- siteConfig={siteConfig}
34
- trackEvent={trackEvent}
35
- eventTypes={eventTypes}
36
- favorites={favorites}
37
- handleSettingFavorites={handleSettingFavorites}
38
- {...props}
39
- />
40
- );
41
- };
42
-
43
- export default ListItemContainer;
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import InfoWindowContent from '~/components/modules/maps/info-window-content';
3
- import { useMapList } from '~/contexts/mapListContext';
4
- import { useTrackEvent } from '~/contexts/trackEventContext';
5
-
6
- const InfoWindowContentContainer = ({
7
- item,
8
- filterListingsByLocation
9
- }) => {
10
- const { trackEvent, eventTypes } = useTrackEvent();
11
- const { setSelectedFilters, setMobileTab, selectedFilters, siteConfig } = useMapList();
12
- const fieldsShown = siteConfig.fieldsShown;
13
- let items = item && item.items ? Object.values(item.items) : null;
14
-
15
- const addressParts = [
16
- items[0].mapDetails?.address?.street,
17
- items[0].mapDetails?.address?.city,
18
- items[0].mapDetails?.address?.state,
19
- items[0].mapDetails?.address?.zip
20
- ];
21
- const fullAddress = addressParts.filter(Boolean).join(', ');
22
-
23
- const applyFilters = () => {
24
- setMobileTab("listTab");
25
- const newFilters = { ...selectedFilters };
26
- let filters = [];
27
-
28
- if (fieldsShown.includes('cityState')) {
29
- newFilters.cityState = { [items[0].fields.cityState]: true };
30
- filters.push({ filterType: 'cityState', filterChecked: items[0].fields.cityState });
31
- }
32
-
33
- if (fieldsShown.includes('city')) {
34
- newFilters.city = { [items[0].fields.city]: true };
35
- filters.push({ filterType: 'city', filterChecked: items[0].fields.city });
36
- }
37
-
38
- if (fieldsShown.includes('state')) {
39
- newFilters.state = { [items[0].fields.state]: true };
40
- filters.push({ filterType: 'state', filterChecked: items[0].fields.state });
41
- }
42
-
43
- trackEvent(eventTypes.VIEW_JOBS_AT_Location, { filtersApplied: filters });
44
- setSelectedFilters(newFilters);
45
- filterListingsByLocation();
46
- };
47
-
48
- return <InfoWindowContent items={items} fullAddress={fullAddress} applyFilters={applyFilters} />;
49
- };
50
-
51
- export default InfoWindowContentContainer;