@abcagency/hc-ui-components 1.3.21 → 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 (149) hide show
  1. package/dist/components/containers/accordions/filter-container.js +4 -2
  2. package/dist/components/containers/accordions/filter-container.js.map +1 -1
  3. package/dist/components/containers/accordions/filter-item-container.js +6 -1
  4. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  5. package/dist/components/containers/accordions/map-accordion-item-container.js +4 -2
  6. package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
  7. package/dist/components/containers/jobListing/listing-details-container.js +2 -2
  8. package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
  9. package/dist/components/containers/list/item-list-container.js +2 -2
  10. package/dist/components/containers/list/item-list-container.js.map +1 -1
  11. package/dist/components/modules/accordions/MapAccordionItem.js +2 -1
  12. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  13. package/dist/components/modules/dialogs/apply-dialog.js +1 -1
  14. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  15. package/dist/components/modules/filter/search.js +1 -1
  16. package/dist/components/modules/filter/search.js.map +1 -1
  17. package/dist/components/modules/jobListing/listing-details.js +5 -4
  18. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  19. package/dist/components/modules/list/field-mapper.js +1 -1
  20. package/dist/components/modules/list/field-mapper.js.map +1 -1
  21. package/dist/components/modules/list/item-list.js.map +1 -1
  22. package/dist/contexts/mapListContext.js.map +1 -1
  23. package/dist/services/listingAggregatorService.js.map +1 -1
  24. package/dist/styles/index.css +3 -1
  25. package/dist/types/components/containers/jobListing/listing-details-container.d.ts +2 -2
  26. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +2 -1
  27. package/dist/types/components/modules/jobListing/listing-details.d.ts +2 -2
  28. package/dist/types/components/modules/list/item-list.d.ts +0 -1
  29. package/dist/types/types/ListingFields.d.ts +5 -0
  30. package/dist/types/types/config/MapConfig.d.ts +1 -0
  31. package/dist/util/filterUtil.js +2 -2
  32. package/dist/util/filterUtil.js.map +1 -1
  33. package/package.json +4 -1
  34. package/.env +0 -3
  35. package/.eslintrc +0 -136
  36. package/bundle.js +0 -28134
  37. package/bundle.js.map +0 -1
  38. package/bundleDist.map +0 -1
  39. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
  40. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
  41. package/jsconfig.json +0 -7
  42. package/postcss.config.js +0 -13
  43. package/preset.default.js +0 -15
  44. package/rollup.config.mjs +0 -111
  45. package/src/.editorconfig +0 -12
  46. package/src/apis/hcApi.ts +0 -109
  47. package/src/bundleIndex.js +0 -14
  48. package/src/clientToken.js +0 -9
  49. package/src/components/HireControlMap.js +0 -135
  50. package/src/components/containers/accordions/filter-container.js +0 -47
  51. package/src/components/containers/accordions/filter-item-container.js +0 -62
  52. package/src/components/containers/accordions/map-accordion-item-container.js +0 -70
  53. package/src/components/containers/filter/commute-container.js +0 -89
  54. package/src/components/containers/filter/filter-container.js +0 -76
  55. package/src/components/containers/filter/filter-item-container.js +0 -71
  56. package/src/components/containers/filter/location-container.js +0 -45
  57. package/src/components/containers/filter/points-of-interest-container.js +0 -33
  58. package/src/components/containers/filter/points-of-interest-radio-item-container.js +0 -35
  59. package/src/components/containers/filter/search-container.js +0 -50
  60. package/src/components/containers/jobListing/listing-details-container.js +0 -40
  61. package/src/components/containers/list/item-list-container.tsx +0 -82
  62. package/src/components/containers/list/list-item/list-item-container.js +0 -43
  63. package/src/components/containers/maps/info-window-content-container.js +0 -51
  64. package/src/components/containers/maps/map-container.js +0 -204
  65. package/src/components/containers/maps/map-list-container.js +0 -48
  66. package/src/components/containers/maps/map-marker-container.js +0 -78
  67. package/src/components/modules/accordions/MapAccordionItem.js +0 -29
  68. package/src/components/modules/accordions/default.js +0 -171
  69. package/src/components/modules/accordions/filterItem.js +0 -27
  70. package/src/components/modules/accordions/filters.js +0 -32
  71. package/src/components/modules/buttons/button-group-apply.js +0 -123
  72. package/src/components/modules/buttons/commute-pill.js +0 -22
  73. package/src/components/modules/buttons/default.js +0 -194
  74. package/src/components/modules/buttons/items-pill.js +0 -35
  75. package/src/components/modules/buttons/pill-wrapper.js +0 -27
  76. package/src/components/modules/buttons/show-all-button.js +0 -20
  77. package/src/components/modules/cards/default.js +0 -167
  78. package/src/components/modules/cards/filter.js +0 -56
  79. package/src/components/modules/dialogs/apply-dialog.js +0 -48
  80. package/src/components/modules/filter/commute.js +0 -108
  81. package/src/components/modules/filter/index.js +0 -55
  82. package/src/components/modules/filter/item.js +0 -48
  83. package/src/components/modules/filter/location.js +0 -48
  84. package/src/components/modules/filter/radio-item.js +0 -42
  85. package/src/components/modules/filter/search.js +0 -65
  86. package/src/components/modules/filter/sort.js +0 -83
  87. package/src/components/modules/grid.js +0 -54
  88. package/src/components/modules/icon.js +0 -33
  89. package/src/components/modules/jobListing/listing-details.js +0 -109
  90. package/src/components/modules/list/field-mapper.js +0 -114
  91. package/src/components/modules/list/header-item.js +0 -91
  92. package/src/components/modules/list/header.js +0 -49
  93. package/src/components/modules/list/item-expand-card/index.js +0 -22
  94. package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +0 -50
  95. package/src/components/modules/list/item-expand-card/recruiter-details.js +0 -68
  96. package/src/components/modules/list/item-expand-card/recruiter-headshot.js +0 -22
  97. package/src/components/modules/list/item-list.tsx +0 -85
  98. package/src/components/modules/list/list-item/list-item.js +0 -130
  99. package/src/components/modules/maps/info-window-card.js +0 -17
  100. package/src/components/modules/maps/info-window-content.js +0 -35
  101. package/src/components/modules/maps/map-list.js +0 -28
  102. package/src/components/modules/maps/map-marker.js +0 -29
  103. package/src/components/modules/maps/map.js +0 -76
  104. package/src/components/modules/maps/place-marker.js +0 -41
  105. package/src/components/modules/maps/tabs.js +0 -81
  106. package/src/constants/eventTypes.js +0 -13
  107. package/src/constants/placeTypes.js +0 -8
  108. package/src/contexts/mapContext.tsx +0 -129
  109. package/src/contexts/mapListContext.tsx +0 -311
  110. package/src/contexts/placesContext.js +0 -102
  111. package/src/contexts/trackEventContext.js +0 -14
  112. package/src/enums/SectionType.ts +0 -9
  113. package/src/hooks/useList.js +0 -89
  114. package/src/index.js +0 -3
  115. package/src/services/configService.ts +0 -16
  116. package/src/services/googlePlacesNearbyService.ts +0 -42
  117. package/src/services/listingAggregatorService.ts +0 -76
  118. package/src/services/listingEntityService.ts +0 -16
  119. package/src/services/listingService.ts +0 -40
  120. package/src/services/recruiterService.ts +0 -18
  121. package/src/styles/bundle.css +0 -268
  122. package/src/styles/index.css +0 -125
  123. package/src/types/Address.ts +0 -7
  124. package/src/types/ContentSection.ts +0 -9
  125. package/src/types/GetListingParams.ts +0 -8
  126. package/src/types/LatLng.ts +0 -4
  127. package/src/types/ListingEntity.ts +0 -11
  128. package/src/types/ListingFields.ts +0 -20
  129. package/src/types/Listings.ts +0 -32
  130. package/src/types/Recruiter.ts +0 -9
  131. package/src/types/SimilarListing.ts +0 -24
  132. package/src/types/config/Colors.ts +0 -8
  133. package/src/types/config/MapConfig.ts +0 -30
  134. package/src/types/config/PointsOfInterestConfig.ts +0 -13
  135. package/src/types/config/SearchConfig.ts +0 -4
  136. package/src/util/arrayUtil.js +0 -3
  137. package/src/util/fieldMapper.js +0 -22
  138. package/src/util/filterUtil.js +0 -239
  139. package/src/util/loading.js +0 -17
  140. package/src/util/localStorageUtil.ts +0 -34
  141. package/src/util/mapIconUtil.js +0 -180
  142. package/src/util/mapUtil.js +0 -91
  143. package/src/util/sortUtil.js +0 -33
  144. package/src/util/stringUtils.js +0 -6
  145. package/src/util/urlFilterUtil.js +0 -85
  146. package/stats.html +0 -4842
  147. package/styles/index.css +0 -1
  148. package/tailwind.config.js +0 -129
  149. 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, recruiters }) => {
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
- recruiters={recruiters}
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,82 +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, recruiters: any) =>
31
- item ? <ListingDetailsContainer item={item} recruiters={recruiters} /> : 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
- itemExpandedContent={itemExpandedContent}
59
- includeFavorite={true}
60
- >
61
- <Accordion className="hc-divide-y hc-divide-uiAccent/10 hc-z-[1000]" defaultValue={selectedListItem?.id}>
62
- {(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type) : filteredListings)
63
- .slice(0, itemLimit)
64
- .map((item: Listing) => (
65
- <MapAccordionItemContainer
66
- key={item.id}
67
- showMap={showMap}
68
- item={item}
69
- itemRefs={itemRefs}
70
- fieldsShown={fieldsShown}
71
- itemExpandedContent={itemExpandedContent}
72
- specialFeatures={specialFeatures}
73
- isActive={selectedListItem?.id === item.id}
74
- hasListItemSelected={selectedListItem != null}
75
- />
76
- ))}
77
- </Accordion>
78
- </ItemsList>
79
- );
80
- };
81
-
82
- 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;