@abcagency/hc-ui-components 1.3.15 → 1.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/hcApi.js +1 -1
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/components/HireControlMap.js +15 -5
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +11 -1
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +36 -15
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/filter/commute.js +22 -6
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js +7 -0
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/item.js +10 -0
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +2 -4
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +7 -0
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +6 -0
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js +20 -0
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/list/index.js +10 -2
- package/dist/components/modules/maps/list/index.js.map +1 -1
- package/dist/components/modules/maps/list/list-item/index.js +12 -2
- package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +10 -0
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/constants/eventTypes.js +16 -0
- package/dist/constants/eventTypes.js.map +1 -0
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +4 -2
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/trackEventContext.js +20 -0
- package/dist/contexts/trackEventContext.js.map +1 -0
- package/dist/hooks/useList.js.map +1 -1
- package/dist/services/apis/hcApi.js +1 -1
- package/dist/services/apis/hcApi.js.map +1 -1
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/components/HireControlMap.js +60 -55
- package/src/components/modules/accordions/MapAccordionItem.js +3 -1
- package/src/components/modules/accordions/filterItem.js +55 -55
- package/src/components/modules/accordions/filters.js +47 -47
- package/src/components/modules/buttons/button-group-apply.js +73 -66
- package/src/components/modules/filter/commute.js +7 -2
- package/src/components/modules/filter/index.js +89 -87
- package/src/components/modules/filter/item.js +87 -81
- package/src/components/modules/filter/location.js +71 -73
- package/src/components/modules/filter/radio-item.js +4 -0
- package/src/components/modules/jobListing/listing-details.js +4 -0
- package/src/components/modules/maps/info-window-content.js +8 -1
- package/src/components/modules/maps/list/index.js +112 -107
- package/src/components/modules/maps/list/list-item/index.js +3 -1
- package/src/components/modules/maps/map-marker.js +3 -1
- package/src/constants/eventTypes.js +13 -0
- package/src/contexts/mapContext.js +101 -101
- package/src/contexts/mapListContext.js +242 -240
- package/src/contexts/trackEventContext.js +14 -0
- package/src/hooks/useList.js +89 -89
- package/src/services/listingAggregatorService.js +50 -50
- package/src/util/mapIconUtil.js +18 -18
- package/src/util/urlFilterUtil.js +90 -90
|
@@ -1,87 +1,89 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import FilterSearch from '~/components/modules/filter/search';
|
|
4
|
-
import FiltersAccordion from '~/components/modules/accordions/filters';
|
|
5
|
-
import FilterLocations from '~/components/modules/filter/location';
|
|
6
|
-
import Button from '~/components/modules/buttons/default';
|
|
7
|
-
|
|
8
|
-
import { useMap } from '~/contexts/mapContext';
|
|
9
|
-
import { useMapList } from '~/contexts/mapListContext';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import FilterSearch from '~/components/modules/filter/search';
|
|
4
|
+
import FiltersAccordion from '~/components/modules/accordions/filters';
|
|
5
|
+
import FilterLocations from '~/components/modules/filter/location';
|
|
6
|
+
import Button from '~/components/modules/buttons/default';
|
|
7
|
+
|
|
8
|
+
import { useMap } from '~/contexts/mapContext';
|
|
9
|
+
import { useMapList } from '~/contexts/mapListContext';
|
|
10
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
11
|
+
|
|
12
|
+
const Filter = ({
|
|
13
|
+
className,
|
|
14
|
+
showMap
|
|
15
|
+
}) => {
|
|
16
|
+
const { trackEvent, eventTypes } = useTrackEvent();
|
|
17
|
+
const [hasActiveFilters, setHasActiveFilters] = useState(false);
|
|
18
|
+
const [defaultValue, setDefaultValue] = useState(null);
|
|
19
|
+
const { setSelectedListItem, setLocation, filterReset } = useMap();
|
|
20
|
+
const {
|
|
21
|
+
filteredListings,
|
|
22
|
+
selectedFilters,
|
|
23
|
+
setSelectedFilters,
|
|
24
|
+
setMobileTab,
|
|
25
|
+
handleSettingFavorites,
|
|
26
|
+
setQuery,
|
|
27
|
+
siteConfig
|
|
28
|
+
} = useMapList();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={`
|
|
33
|
+
hc-relative hc-max-h-[95vh] md:hc-max-h-screen hc-overflow-y-auto hc-overflow-x-auto
|
|
34
|
+
${className ?? ""}
|
|
35
|
+
`}
|
|
36
|
+
>
|
|
37
|
+
<div className="hc-px-4 md:hc-pt-4 hc-space-y-4">
|
|
38
|
+
<FiltersAccordion
|
|
39
|
+
setHasActiveFilters={setHasActiveFilters}
|
|
40
|
+
defaultValue={defaultValue}
|
|
41
|
+
setDefaultValue={value => { setDefaultValue(value == defaultValue ? "" : value); }}
|
|
42
|
+
setLocation={setLocation}
|
|
43
|
+
setSelectedListItem={setSelectedListItem}
|
|
44
|
+
/>
|
|
45
|
+
<FilterSearch />
|
|
46
|
+
{siteConfig.hideLocations !== true &&
|
|
47
|
+
<FilterLocations
|
|
48
|
+
setHasActiveFilters={setHasActiveFilters}
|
|
49
|
+
defaultValue={defaultValue}
|
|
50
|
+
showMap={showMap}
|
|
51
|
+
setDefaultValue={value => { setDefaultValue(value == defaultValue ? "" : value); }}
|
|
52
|
+
setLocation={setLocation}
|
|
53
|
+
setSelectedListItem={setSelectedListItem}
|
|
54
|
+
/>
|
|
55
|
+
}
|
|
56
|
+
</div>
|
|
57
|
+
<div className="hc-sticky hc-bottom-0 hc-inset-x-0 hc-flex hc-items-center hc-justify-between hc-gap-2 hc-py-2 hc-px-4 hc-mt-2 hc-bg-white md:hc-bg-gray-100">
|
|
58
|
+
<Button.Btn
|
|
59
|
+
onClick={() => {trackEvent(eventTypes.FILTERS_RESET, { filtersRemoved: selectedFilters }); filterReset(); setSelectedFilters({}); setQuery(null); handleSettingFavorites(null); }}
|
|
60
|
+
variant="outline"
|
|
61
|
+
size="sm"
|
|
62
|
+
>
|
|
63
|
+
Reset
|
|
64
|
+
</Button.Btn>
|
|
65
|
+
{selectedFilters && Object.keys(selectedFilters).length > 0 &&
|
|
66
|
+
<Button.Btn
|
|
67
|
+
onClick={() => setMobileTab("listTab")}
|
|
68
|
+
variant="primary"
|
|
69
|
+
size="sm"
|
|
70
|
+
className={`
|
|
71
|
+
md:hc-hidden
|
|
72
|
+
${hasActiveFilters ? "hc-opacity-0 hc-pointer-events-none" : "hc-opacity-100"}
|
|
73
|
+
`}
|
|
74
|
+
>
|
|
75
|
+
<Button.Body>
|
|
76
|
+
<Button.Icon
|
|
77
|
+
icon="fluent:search-12-filled"
|
|
78
|
+
size="hc-size-3.5"
|
|
79
|
+
/>
|
|
80
|
+
Show {filteredListings.length} Jobs
|
|
81
|
+
</Button.Body>
|
|
82
|
+
</Button.Btn>
|
|
83
|
+
}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default Filter;
|
|
@@ -1,81 +1,87 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
4
|
+
|
|
5
|
+
const FilterItem = ({
|
|
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
|
+
var isActive =
|
|
20
|
+
selectedFilters != undefined && !!selectedFilters[field]?.[itemKey];
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if(!selectedFilters)
|
|
24
|
+
return;
|
|
25
|
+
setActiveItem(!!selectedFilters[field]?.[itemKey]);
|
|
26
|
+
},[selectedFilters, field, itemKey]);
|
|
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
|
+
const [activeItem, setActiveItem] = useState(isActive);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (selectedFilters && selectedFilters[field] && Object.keys(selectedFilters[field])?.length > 0) return;
|
|
51
|
+
else if (activeItem === true) {
|
|
52
|
+
setActiveItem(false);
|
|
53
|
+
}
|
|
54
|
+
}, [selectedFilters]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<label
|
|
58
|
+
className={`
|
|
59
|
+
hc-flex hc-items-start hc-gap-2 hc-px-2 hc-py-1.5 hc-rounded-sm hc-text-sm hc-cursor-pointer hc-transition hover:hc-bg-uiAccent/5
|
|
60
|
+
${className ?? ""}
|
|
61
|
+
`}
|
|
62
|
+
{...rest}
|
|
63
|
+
>
|
|
64
|
+
<input
|
|
65
|
+
id={itemKey}
|
|
66
|
+
name={field}
|
|
67
|
+
disabled={item.count == 0}
|
|
68
|
+
value={itemName}
|
|
69
|
+
type={type}
|
|
70
|
+
className={`hc-size-4 hc-mt-px hc-text-primary hc-border-uiAccent/30 hc-transition-colors hc-rounded-sm`}
|
|
71
|
+
checked={activeItem}
|
|
72
|
+
onChange={() => {
|
|
73
|
+
setActiveItem(!activeItem);
|
|
74
|
+
changeHandler();
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
<span className="font-medium">{itemName}</span>
|
|
78
|
+
{hasCount && (
|
|
79
|
+
<span className="hc-inline-block hc-mt-1 hc-ml-auto hc-text-xs hc-leading-none hc-text-primary">
|
|
80
|
+
({item.count})
|
|
81
|
+
</span>
|
|
82
|
+
)}
|
|
83
|
+
</label>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default FilterItem;
|
|
@@ -1,73 +1,71 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
import Accordion from '~/components/modules/accordions/default';
|
|
4
|
-
import FilterCommute from '~/components/modules/filter/commute';
|
|
5
|
-
import FilterPointsOfInterest from '~/components/modules/filter/points-of-interest';
|
|
6
|
-
import FilterCard from '~/components/modules/cards/filter';
|
|
7
|
-
import AccordionFilterItem from '~/components/modules/accordions/filterItem';
|
|
8
|
-
|
|
9
|
-
import Loading from '~/util/loading';
|
|
10
|
-
|
|
11
|
-
import { useMapList } from '~/contexts/mapListContext';
|
|
12
|
-
|
|
13
|
-
const FilterLocation = ({
|
|
14
|
-
className,
|
|
15
|
-
defaultValue,
|
|
16
|
-
setDefaultValue,
|
|
17
|
-
showMap = false,
|
|
18
|
-
setLocation,
|
|
19
|
-
setSelectedListItem
|
|
20
|
-
}) => {
|
|
21
|
-
const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
|
|
22
|
-
// const activeItemsCount = selectedFilters != null && selectedFilters["cityState"]
|
|
23
|
-
// ? Object.keys(selectedFilters["cityState"]).length
|
|
24
|
-
// : 0;
|
|
25
|
-
|
|
26
|
-
// const handleClearFilters = () => {
|
|
27
|
-
// setSelectedFilters(prevFilters => {
|
|
28
|
-
// const updatedFilters = { ...prevFilters };
|
|
29
|
-
// delete updatedFilters["cityState"];
|
|
30
|
-
// return updatedFilters;
|
|
31
|
-
// });
|
|
32
|
-
// };
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export default FilterLocation;
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import Accordion from '~/components/modules/accordions/default';
|
|
4
|
+
import FilterCommute from '~/components/modules/filter/commute';
|
|
5
|
+
import FilterPointsOfInterest from '~/components/modules/filter/points-of-interest';
|
|
6
|
+
import FilterCard from '~/components/modules/cards/filter';
|
|
7
|
+
import AccordionFilterItem from '~/components/modules/accordions/filterItem';
|
|
8
|
+
|
|
9
|
+
import Loading from '~/util/loading';
|
|
10
|
+
|
|
11
|
+
import { useMapList } from '~/contexts/mapListContext';
|
|
12
|
+
|
|
13
|
+
const FilterLocation = ({
|
|
14
|
+
className,
|
|
15
|
+
defaultValue,
|
|
16
|
+
setDefaultValue,
|
|
17
|
+
showMap = false,
|
|
18
|
+
setLocation,
|
|
19
|
+
setSelectedListItem
|
|
20
|
+
}) => {
|
|
21
|
+
const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
|
|
22
|
+
// const activeItemsCount = selectedFilters != null && selectedFilters["cityState"]
|
|
23
|
+
// ? Object.keys(selectedFilters["cityState"]).length
|
|
24
|
+
// : 0;
|
|
25
|
+
|
|
26
|
+
// const handleClearFilters = () => {
|
|
27
|
+
// setSelectedFilters(prevFilters => {
|
|
28
|
+
// const updatedFilters = { ...prevFilters };
|
|
29
|
+
// delete updatedFilters["cityState"];
|
|
30
|
+
// return updatedFilters;
|
|
31
|
+
// });
|
|
32
|
+
// };
|
|
33
|
+
|
|
34
|
+
var locations = filterOptions?.locations;
|
|
35
|
+
var pointsOfInterest = filterOptions?.pointsOfInterest;
|
|
36
|
+
return (
|
|
37
|
+
<FilterCard className={className ?? ""}>
|
|
38
|
+
<FilterCard.Title icon="fluent:location-16-filled">
|
|
39
|
+
<span>
|
|
40
|
+
<span className="hc-hidden lg:hc-inline">Job</span> location
|
|
41
|
+
</span>
|
|
42
|
+
</FilterCard.Title>
|
|
43
|
+
{!locations && (
|
|
44
|
+
<Loading />
|
|
45
|
+
)}
|
|
46
|
+
{locations && <Accordion defaultValue={defaultValue} className="hc-space-y-4">
|
|
47
|
+
{locations?.map(filter => (
|
|
48
|
+
<AccordionFilterItem
|
|
49
|
+
key={filter.id}
|
|
50
|
+
filter={filter}
|
|
51
|
+
setDefaultValue={setDefaultValue}
|
|
52
|
+
selectedFilters={selectedFilters}
|
|
53
|
+
setSelectedFilters={prevFilters => { setSelectedFilters(prevFilters); setLocation(null); setSelectedListItem(null); }}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
{showMap && <FilterCommute className="hc-mt-6" />}
|
|
57
|
+
{showMap && (
|
|
58
|
+
<FilterPointsOfInterest
|
|
59
|
+
className="hc-mt-4"
|
|
60
|
+
pointsOfInterest={pointsOfInterest}
|
|
61
|
+
setDefaultValue={setDefaultValue}
|
|
62
|
+
defaultValue={defaultValue}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</Accordion>
|
|
66
|
+
}
|
|
67
|
+
</FilterCard>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default FilterLocation;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import Icon from '~/components/modules/icon';
|
|
4
4
|
|
|
5
5
|
import { useMap } from "~/contexts/mapContext";
|
|
6
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
6
7
|
|
|
7
8
|
const RadioItem = ({
|
|
8
9
|
className,
|
|
@@ -10,11 +11,14 @@ const RadioItem = ({
|
|
|
10
11
|
field,
|
|
11
12
|
...rest
|
|
12
13
|
}) => {
|
|
14
|
+
const { trackEvent, eventTypes } = useTrackEvent();
|
|
13
15
|
const { selectedPlaces, setSelectedPlaces } = useMap();
|
|
14
16
|
const chosenPlace = item.key.toLowerCase();
|
|
15
17
|
let isActive = selectedPlaces.includes(chosenPlace);
|
|
16
18
|
|
|
17
19
|
const changeHandler = () => {
|
|
20
|
+
if(!isActive)
|
|
21
|
+
trackEvent(eventTypes.POI_APPLIED, { chosenPlace });
|
|
18
22
|
setSelectedPlaces([isActive ? '' : chosenPlace]);
|
|
19
23
|
};
|
|
20
24
|
|
|
@@ -8,8 +8,10 @@ import CommutePill from '~/components/modules/buttons/commute-pill';
|
|
|
8
8
|
|
|
9
9
|
import { useMap } from '~/contexts/mapContext';
|
|
10
10
|
import { useMapList } from '~/contexts/mapListContext';
|
|
11
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
11
12
|
|
|
12
13
|
const ListingDetails = ({ item, recruiters }) => {
|
|
14
|
+
const { trackEvent, eventTypes } = useTrackEvent();
|
|
13
15
|
const { travelTime } = useMap();
|
|
14
16
|
const { siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat } = useMapList();
|
|
15
17
|
if (!item) {
|
|
@@ -78,6 +80,8 @@ const ListingDetails = ({ item, recruiters }) => {
|
|
|
78
80
|
applyUrl={item?.applyUrl}
|
|
79
81
|
itemId={item.id}
|
|
80
82
|
item={item}
|
|
83
|
+
trackEvent={trackEvent}
|
|
84
|
+
eventTypes={eventTypes}
|
|
81
85
|
detailsUrl={item.useClientJobUrl ? item?.detailsUrl : `${siteConfig.jobsDomain}${item.id}`}
|
|
82
86
|
className={`
|
|
83
87
|
lg:hc-w-auto hc-order-first lg:hc-order-last md:hc-self-center hc-py-2 lg:hc-p-0 lg:hc-mb-0 hc-border-b lg:hc-border-none hc-border-uiAccent/20
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { useMapList } from '~/contexts/mapListContext';
|
|
4
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
4
5
|
|
|
5
6
|
const InfoWindowContent = ({
|
|
6
7
|
item,
|
|
7
8
|
filterListingsByLocation
|
|
8
9
|
}) => {
|
|
10
|
+
const { trackEvent, eventTypes } = useTrackEvent();
|
|
9
11
|
const { setSelectedFilters, setMobileTab, selectedFilters, siteConfig } = useMapList();
|
|
10
12
|
const fieldsShown = siteConfig.fieldsShown;
|
|
11
13
|
let items = item && item.items ? Object.values(item.items) : null;
|
|
@@ -35,27 +37,32 @@ const InfoWindowContent = ({
|
|
|
35
37
|
<button
|
|
36
38
|
className="hc-cursor-pointer hover:hc-opacity-70 hc-text-primary"
|
|
37
39
|
onClick={() => {
|
|
40
|
+
|
|
38
41
|
setMobileTab("listTab");
|
|
39
42
|
const newFilters = { ...selectedFilters };
|
|
43
|
+
let filters = [];
|
|
40
44
|
|
|
41
45
|
if (fieldsShown.includes('cityState')) {
|
|
42
46
|
newFilters.cityState = {
|
|
43
47
|
[items[0].fields.cityState]: true
|
|
44
48
|
};
|
|
49
|
+
filters.push({ filterType: 'cityState', filterChecked: items[0].fields.cityState });
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
if (fieldsShown.includes('city')) {
|
|
48
53
|
newFilters.city = {
|
|
49
54
|
[items[0].fields.city]: true
|
|
50
55
|
};
|
|
56
|
+
filters.push({ filterType: 'city', filterChecked: items[0].fields.city });
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
if (fieldsShown.includes('state')) {
|
|
54
60
|
newFilters.state = {
|
|
55
61
|
[items[0].fields.state]: true
|
|
56
62
|
};
|
|
63
|
+
filters.push({ filterType: 'state', filterChecked: items[0].fields.state });
|
|
57
64
|
}
|
|
58
|
-
|
|
65
|
+
trackEvent(eventTypes.VIEW_JOBS_AT_Location, { filtersApplied: filters });
|
|
59
66
|
setSelectedFilters(newFilters);
|
|
60
67
|
filterListingsByLocation();
|
|
61
68
|
}}
|