@abcagency/hc-ui-components 1.3.15 → 1.3.16

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 (62) hide show
  1. package/dist/components/HireControlMap.js +15 -5
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/modules/accordions/MapAccordionItem.js +11 -1
  4. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  5. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  6. package/dist/components/modules/accordions/filters.js.map +1 -1
  7. package/dist/components/modules/buttons/button-group-apply.js +36 -15
  8. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  9. package/dist/components/modules/filter/commute.js +22 -6
  10. package/dist/components/modules/filter/commute.js.map +1 -1
  11. package/dist/components/modules/filter/index.js +7 -0
  12. package/dist/components/modules/filter/index.js.map +1 -1
  13. package/dist/components/modules/filter/item.js +10 -0
  14. package/dist/components/modules/filter/item.js.map +1 -1
  15. package/dist/components/modules/filter/location.js +2 -4
  16. package/dist/components/modules/filter/location.js.map +1 -1
  17. package/dist/components/modules/filter/radio-item.js +7 -0
  18. package/dist/components/modules/filter/radio-item.js.map +1 -1
  19. package/dist/components/modules/jobListing/listing-details.js +6 -0
  20. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  21. package/dist/components/modules/maps/info-window-content.js +20 -0
  22. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  23. package/dist/components/modules/maps/list/index.js +10 -2
  24. package/dist/components/modules/maps/list/index.js.map +1 -1
  25. package/dist/components/modules/maps/list/list-item/index.js +12 -2
  26. package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
  27. package/dist/components/modules/maps/map-marker.js +10 -0
  28. package/dist/components/modules/maps/map-marker.js.map +1 -1
  29. package/dist/constants/eventTypes.js +16 -0
  30. package/dist/constants/eventTypes.js.map +1 -0
  31. package/dist/contexts/mapContext.js.map +1 -1
  32. package/dist/contexts/mapListContext.js +4 -2
  33. package/dist/contexts/mapListContext.js.map +1 -1
  34. package/dist/contexts/trackEventContext.js +20 -0
  35. package/dist/contexts/trackEventContext.js.map +1 -0
  36. package/dist/hooks/useList.js.map +1 -1
  37. package/dist/services/listingAggregatorService.js.map +1 -1
  38. package/dist/util/mapIconUtil.js.map +1 -1
  39. package/package.json +60 -60
  40. package/src/components/HireControlMap.js +60 -55
  41. package/src/components/modules/accordions/MapAccordionItem.js +3 -1
  42. package/src/components/modules/accordions/filterItem.js +55 -55
  43. package/src/components/modules/accordions/filters.js +47 -47
  44. package/src/components/modules/buttons/button-group-apply.js +73 -66
  45. package/src/components/modules/filter/commute.js +7 -2
  46. package/src/components/modules/filter/index.js +89 -87
  47. package/src/components/modules/filter/item.js +87 -81
  48. package/src/components/modules/filter/location.js +71 -73
  49. package/src/components/modules/filter/radio-item.js +4 -0
  50. package/src/components/modules/jobListing/listing-details.js +4 -0
  51. package/src/components/modules/maps/info-window-content.js +8 -1
  52. package/src/components/modules/maps/list/index.js +112 -107
  53. package/src/components/modules/maps/list/list-item/index.js +3 -1
  54. package/src/components/modules/maps/map-marker.js +3 -1
  55. package/src/constants/eventTypes.js +13 -0
  56. package/src/contexts/mapContext.js +101 -101
  57. package/src/contexts/mapListContext.js +242 -240
  58. package/src/contexts/trackEventContext.js +14 -0
  59. package/src/hooks/useList.js +89 -89
  60. package/src/services/listingAggregatorService.js +50 -50
  61. package/src/util/mapIconUtil.js +18 -18
  62. package/src/util/urlFilterUtil.js +90 -90
@@ -8,6 +8,7 @@ import MapList from '~/components/modules/maps/map-list';
8
8
  import { MapProvider } from '~/contexts/mapContext';
9
9
  import { PlacesProvider } from '~/contexts/placesContext';
10
10
  import { MapListProvider } from '~/contexts/mapListContext';
11
+ import { TrackEventProvider } from '~/contexts/trackEventContext';
11
12
 
12
13
  import { getMapConfig } from '~/services/configService';
13
14
  import { setClientAuthKey } from '~/clientToken.js';
@@ -21,7 +22,8 @@ export const HireControlMap = ({
21
22
  navigateToDetails = null,
22
23
  navigateToEasyApply = null,
23
24
  Link = null,
24
- linkFormat = '/jobs/[slug]'
25
+ linkFormat = '/jobs/[slug]',
26
+ trackEvent = (eventType, eventObj) => {console.log(eventType); console.log(eventObj);}
25
27
  }) => {
26
28
  const [siteConfig, setSiteconfig] = useState(null);
27
29
 
@@ -54,70 +56,73 @@ export const HireControlMap = ({
54
56
  navigateToEasyApply={navigateToEasyApply}
55
57
  Link={Link}
56
58
  linkFormat={linkFormat}
59
+ trackEvent={trackEvent}
57
60
  />
58
61
  )}
59
62
  </div>
60
63
  );
61
64
  };
62
65
 
63
- const HomeBody = ({ siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat }) => {
66
+ const HomeBody = ({ siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat, trackEvent }) => {
64
67
  const resetFilters = false;
65
68
 
66
69
  return (
67
- <MapListProvider
68
- siteConfig={siteConfig}
69
- resetFilters={resetFilters}
70
- avigateToDetails={navigateToDetails}
71
- navigateToEasyApply={navigateToEasyApply}
72
- Link={Link}
73
- linkFormat={linkFormat}
74
- >
75
- <MapProvider resetFilters={resetFilters}>
76
- <PlacesProvider
77
- placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
78
- markerColors={{
79
- fillColor: siteConfig.colors.primary,
80
- strokeColor: siteConfig.colors.primaryDark,
81
- selectedFillColor: siteConfig.colors.secondary,
82
- selectedStrokeColor: siteConfig.colors.secondaryDark,
83
- placeMarkers: {
84
- colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
85
- size: siteConfig.pointsOfInterestConfig.placeMarkerSize
86
- }
87
- }}
88
- >
89
- <Grid
90
- as='section'
91
- id='job-search-interface'
92
- columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
93
- gap='hc-gap-0'
94
- autoRows={false}
95
- className='hc-items-stretch hc-h-screen hc-min-h-[30rem] hc-divide-x hc-divide-uiAccent/20'
70
+ <TrackEventProvider trackEvent={trackEvent}>
71
+ <MapListProvider
72
+ siteConfig={siteConfig}
73
+ resetFilters={resetFilters}
74
+ avigateToDetails={navigateToDetails}
75
+ navigateToEasyApply={navigateToEasyApply}
76
+ Link={Link}
77
+ linkFormat={linkFormat}
78
+ >
79
+ <MapProvider resetFilters={resetFilters}>
80
+ <PlacesProvider
81
+ placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
82
+ markerColors={{
83
+ fillColor: siteConfig.colors.primary,
84
+ strokeColor: siteConfig.colors.primaryDark,
85
+ selectedFillColor: siteConfig.colors.secondary,
86
+ selectedStrokeColor: siteConfig.colors.secondaryDark,
87
+ placeMarkers: {
88
+ colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
89
+ size: siteConfig.pointsOfInterestConfig.placeMarkerSize
90
+ }
91
+ }}
96
92
  >
97
- <Grid.Item className='hc-bg-gray-100'>
98
- <Filter showMap={siteConfig.showMap} className='hc-hidden md:hc-block' />
99
- </Grid.Item>
100
- <MapList
101
- markerConfigs={{
102
- fillColor: siteConfig.colors.primary,
103
- strokeColor: siteConfig.colors.primaryDark,
104
- selectedFillColor: siteConfig.colors.secondary,
105
- selectedStrokeColor: siteConfig.colors.secondaryDark,
106
- placeMarkers: {
107
- colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
108
- size: siteConfig.pointsOfInterestConfig.placeMarkerSize
109
- }
110
- }}
111
- showMap={siteConfig.showMap}
112
- fieldsShown={siteConfig.fieldsShown}
113
- specialFeatures={siteConfig.specialFeatures}
114
- fieldNames={siteConfig.fieldNames}
115
- placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
116
- />
117
- </Grid>
118
- </PlacesProvider>
119
- </MapProvider>
120
- </MapListProvider>
93
+ <Grid
94
+ as='section'
95
+ id='job-search-interface'
96
+ columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
97
+ gap='hc-gap-0'
98
+ autoRows={false}
99
+ className='hc-items-stretch hc-h-screen hc-min-h-[30rem] hc-divide-x hc-divide-uiAccent/20'
100
+ >
101
+ <Grid.Item className='hc-bg-gray-100'>
102
+ <Filter showMap={siteConfig.showMap} className='hc-hidden md:hc-block' />
103
+ </Grid.Item>
104
+ <MapList
105
+ markerConfigs={{
106
+ fillColor: siteConfig.colors.primary,
107
+ strokeColor: siteConfig.colors.primaryDark,
108
+ selectedFillColor: siteConfig.colors.secondary,
109
+ selectedStrokeColor: siteConfig.colors.secondaryDark,
110
+ placeMarkers: {
111
+ colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
112
+ size: siteConfig.pointsOfInterestConfig.placeMarkerSize
113
+ }
114
+ }}
115
+ showMap={siteConfig.showMap}
116
+ fieldsShown={siteConfig.fieldsShown}
117
+ specialFeatures={siteConfig.specialFeatures}
118
+ fieldNames={siteConfig.fieldNames}
119
+ placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
120
+ />
121
+ </Grid>
122
+ </PlacesProvider>
123
+ </MapProvider>
124
+ </MapListProvider>
125
+ </TrackEventProvider>
121
126
  );
122
127
  };
123
128
 
@@ -6,6 +6,7 @@ import ItemExpandCard from '~/components/modules/maps/list/item-expand-card';
6
6
 
7
7
  import { useMap } from '~/contexts/mapContext';
8
8
  import { useMapList } from '~/contexts/mapListContext';
9
+ import { useTrackEvent } from '~/contexts/trackEventContext';
9
10
 
10
11
  import { setStorageObject } from '~/util/localStorageUtil';
11
12
 
@@ -27,6 +28,7 @@ const MapAccordionItem = ({
27
28
  handleSettingFavorites
28
29
  } = useMapList();
29
30
  const { selectItem } = useMap();
31
+ const { trackEvent, eventTypes } = useTrackEvent();
30
32
  const setSelectedItemAndZoomMap = item => {
31
33
  if (isActive) {
32
34
  localStorage.removeItem("selectedListItem");
@@ -50,7 +52,7 @@ const MapAccordionItem = ({
50
52
  key={item.id}
51
53
  item={item}
52
54
  fieldsShown={fieldsShown}
53
- onClick={() => setSelectedItemAndZoomMap(item)}
55
+ onClick={() => { trackEvent(eventTypes.JOB_LISTING_SELECTED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });setSelectedItemAndZoomMap(item);}}
54
56
  showMap={showMap}
55
57
  isActive={isActive}
56
58
  setMobileTab={setMobileTab}
@@ -1,55 +1,55 @@
1
- import React, { memo } from 'react';
2
-
3
- import Accordion from '~/components/modules/accordions/default';
4
- import FilterItem from '~/components/modules/filter/item';
5
- import ItemsPill from '~/components/modules/buttons/items-pill';
6
-
7
- const AccordionFilterItem = memo(({ filter, setDefaultValue, setSelectedFilters, selectedFilters }) => {
8
- const fieldKey = filter.id;
9
- const activeItemsCount = selectedFilters != null && selectedFilters[fieldKey]
10
- ? Object.keys(selectedFilters[fieldKey]).length
11
- : 0;
12
-
13
- const handleClearFilters = event => {
14
- event.stopPropagation();
15
-
16
- setSelectedFilters(prevFilters => {
17
- const updatedFilters = { ...prevFilters };
18
- delete updatedFilters[fieldKey];
19
- return updatedFilters;
20
- });
21
- };
22
- return (
23
- <Accordion.Item key={filter.id} id={filter.id}>
24
- <Accordion.Trigger.HasHeader
25
- onClick={() => setDefaultValue(filter.id)}
26
- className="hc-stretched-link hc-text-left"
27
- iconClassName="hc-order-last"
28
- headerClassName="hc-relative hc-py-2 hc-rounded hc-border hc-border-uiAccent/20 hc-bg-white hc-text-sm hc-transition data-[state=open]:hc-border-b-transparent data-[state=open]:hc-rounded-b-none"
29
- header={
30
- activeItemsCount > 0 && (
31
- <ItemsPill
32
- activeItemsCount={activeItemsCount}
33
- onClick={handleClearFilters}
34
- />
35
- )
36
- }
37
- >
38
- {filter.title}
39
- </Accordion.Trigger.HasHeader>
40
- <Accordion.Content bodyClassName="hc-px-2 hc-py-1 hc-bg-white hc-rounded-b hc-border hc-border-uiAccent/20 hc-border-t-0 hc-max-h-[20vh] md:hc-max-h-[25vh] hc-overflow-auto">
41
- {filter.items.sort().map(item => (
42
- <FilterItem
43
- key={item.name}
44
- item={item}
45
- field={filter.id}
46
- selectedFilters={selectedFilters}
47
- setSelectedFilters={setSelectedFilters}
48
- />
49
- ))}
50
- </Accordion.Content>
51
- </Accordion.Item>
52
- );
53
- });
54
- AccordionFilterItem.displayName = 'AccordionItem';
55
- export default AccordionFilterItem;
1
+ import React, { memo } from 'react';
2
+
3
+ import Accordion from '~/components/modules/accordions/default';
4
+ import FilterItem from '~/components/modules/filter/item';
5
+ import ItemsPill from '~/components/modules/buttons/items-pill';
6
+
7
+ const AccordionFilterItem = memo(({ filter, setDefaultValue, setSelectedFilters, selectedFilters }) => {
8
+ const fieldKey = filter.id;
9
+ const activeItemsCount = selectedFilters != null && selectedFilters[fieldKey]
10
+ ? Object.keys(selectedFilters[fieldKey]).length
11
+ : 0;
12
+
13
+ const handleClearFilters = event => {
14
+ event.stopPropagation();
15
+
16
+ setSelectedFilters(prevFilters => {
17
+ const updatedFilters = { ...prevFilters };
18
+ delete updatedFilters[fieldKey];
19
+ return updatedFilters;
20
+ });
21
+ };
22
+ return (
23
+ <Accordion.Item key={filter.id} id={filter.id}>
24
+ <Accordion.Trigger.HasHeader
25
+ onClick={() => setDefaultValue(filter.id)}
26
+ className="hc-stretched-link hc-text-left"
27
+ iconClassName="hc-order-last"
28
+ headerClassName="hc-relative hc-py-2 hc-rounded hc-border hc-border-uiAccent/20 hc-bg-white hc-text-sm hc-transition data-[state=open]:hc-border-b-transparent data-[state=open]:hc-rounded-b-none"
29
+ header={
30
+ activeItemsCount > 0 && (
31
+ <ItemsPill
32
+ activeItemsCount={activeItemsCount}
33
+ onClick={handleClearFilters}
34
+ />
35
+ )
36
+ }
37
+ >
38
+ {filter.title}
39
+ </Accordion.Trigger.HasHeader>
40
+ <Accordion.Content bodyClassName="hc-px-2 hc-py-1 hc-bg-white hc-rounded-b hc-border hc-border-uiAccent/20 hc-border-t-0 hc-max-h-[20vh] md:hc-max-h-[25vh] hc-overflow-auto">
41
+ {filter.items.sort().map(item => (
42
+ <FilterItem
43
+ key={item.name}
44
+ item={item}
45
+ field={filter.id}
46
+ selectedFilters={selectedFilters}
47
+ setSelectedFilters={setSelectedFilters}
48
+ />
49
+ ))}
50
+ </Accordion.Content>
51
+ </Accordion.Item>
52
+ );
53
+ });
54
+ AccordionFilterItem.displayName = 'AccordionItem';
55
+ export default AccordionFilterItem;
@@ -1,47 +1,47 @@
1
- import React from 'react';
2
- import Accordion from '~/components/modules/accordions/default';
3
- import AccordionFilterItem from '~/components/modules/accordions/filterItem';
4
- import FilterCard from '~/components/modules/cards/filter';
5
-
6
- import { useMapList } from '~/contexts/mapListContext';
7
-
8
- import Loading from '~/util/loading';
9
-
10
- const AccordionFilters = ({
11
- className,
12
- defaultValue,
13
- setDefaultValue,
14
- setLocation,
15
- setSelectedListItem
16
- }) => {
17
- const { filterOptions, selectedFilters, setSelectedFilters } = useMapList();
18
-
19
- return (
20
- <FilterCard className={className ?? ""}>
21
- <FilterCard.Title icon="fa-solid:sliders-h">
22
- <span>
23
- Filter <span className="md:hc-hidden lg:hc-inline">your search</span>
24
- </span>
25
- </FilterCard.Title>
26
-
27
- <Accordion defaultValue={defaultValue} className="hc-space-y-4" >
28
- {!filterOptions?.filters && (
29
- <Accordion.Item>
30
- <Loading />
31
- </Accordion.Item>
32
- )}
33
- {filterOptions?.filters && filterOptions?.filters.map(filter => (
34
- <AccordionFilterItem
35
- key={filter.id}
36
- filter={filter}
37
- setDefaultValue={setDefaultValue}
38
- selectedFilters={selectedFilters}
39
- setSelectedFilters={prevFilters => { setSelectedFilters(prevFilters); setLocation(null); setSelectedListItem(null); }}
40
- />
41
- ))}
42
- </Accordion>
43
- </FilterCard>
44
- );
45
- };
46
-
47
- export default AccordionFilters;
1
+ import React from 'react';
2
+ import Accordion from '~/components/modules/accordions/default';
3
+ import AccordionFilterItem from '~/components/modules/accordions/filterItem';
4
+ import FilterCard from '~/components/modules/cards/filter';
5
+
6
+ import { useMapList } from '~/contexts/mapListContext';
7
+
8
+ import Loading from '~/util/loading';
9
+
10
+ const AccordionFilters = ({
11
+ className,
12
+ defaultValue,
13
+ setDefaultValue,
14
+ setLocation,
15
+ setSelectedListItem
16
+ }) => {
17
+ const { filterOptions, selectedFilters, setSelectedFilters } = useMapList();
18
+
19
+ return (
20
+ <FilterCard className={className ?? ""}>
21
+ <FilterCard.Title icon="fa-solid:sliders-h">
22
+ <span>
23
+ Filter <span className="md:hc-hidden lg:hc-inline">your search</span>
24
+ </span>
25
+ </FilterCard.Title>
26
+
27
+ <Accordion defaultValue={defaultValue} className="hc-space-y-4" >
28
+ {!filterOptions?.filters && (
29
+ <Accordion.Item>
30
+ <Loading />
31
+ </Accordion.Item>
32
+ )}
33
+ {filterOptions?.filters && filterOptions?.filters.map(filter => (
34
+ <AccordionFilterItem
35
+ key={filter.id}
36
+ filter={filter}
37
+ setDefaultValue={setDefaultValue}
38
+ selectedFilters={selectedFilters}
39
+ setSelectedFilters={prevFilters => { setSelectedFilters(prevFilters); setLocation(null); setSelectedListItem(null); }}
40
+ />
41
+ ))}
42
+ </Accordion>
43
+ </FilterCard>
44
+ );
45
+ };
46
+
47
+ export default AccordionFilters;
@@ -22,92 +22,99 @@ const ButtonGroupApply = ({
22
22
  internalApplyLink,
23
23
  itemId,
24
24
  item,
25
- companyName
25
+ companyName,
26
+ trackEvent,
27
+ eventTypes
26
28
  }) => {
27
- const applyButton = () => {
28
- return <Button.Anchor
29
- variant={applyButtonVariant}
30
- size={buttonSize}
31
- >
32
- {applyText}
33
- </Button.Anchor>;;
29
+ const href = linkFormat.replace('[slug]', item.slug ?? item.id);
30
+
31
+ const trackApply = () => {
32
+ trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
34
33
  };
35
34
 
36
- const href = linkFormat.replace('[slug]', item.slug ?? item.id);
35
+ const trackViewDetails = () => {
36
+ trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
37
+ };
37
38
 
38
39
  return (
39
40
  <nav
40
41
  className={twMerge`
41
- hc-flex hc-flex-row hc-justify-between hc-gap-2 hc-w-full
42
- ${className ?? ''}
43
- `}
42
+ hc-flex hc-flex-row hc-justify-between hc-gap-2 hc-w-full
43
+ ${className ?? ''}
44
+ `}
44
45
  >
45
46
  {Link &&
46
- <Button.Link
47
- Link={Link}
48
- href={href}
49
- variant={detailsButtonVariant}
50
- size={buttonSize}
51
- >
52
- {detailsText}
53
- </Button.Link>
47
+ <Button.Link
48
+ Link={Link}
49
+ href={href}
50
+ variant={detailsButtonVariant}
51
+ size={buttonSize}
52
+ onClick={trackViewDetails}
53
+ >
54
+ {detailsText}
55
+ </Button.Link>
54
56
  }
55
57
  {navigateToDetails &&
56
- <Button.Anchor
57
- href={href}
58
- onClick={e => {
59
- e.preventDefault();
60
- navigateToDetails(item);
61
- }}
62
- variant={detailsButtonVariant}
63
- size={buttonSize}
64
- >
65
- {detailsText}
66
- </Button.Anchor>
58
+ <Button.Anchor
59
+ href={href}
60
+ onClick={e => {
61
+ e.preventDefault();
62
+ navigateToDetails(item);
63
+ trackViewDetails();
64
+ }}
65
+ variant={detailsButtonVariant}
66
+ size={buttonSize}
67
+ >
68
+ {detailsText}
69
+ </Button.Anchor>
67
70
  }
68
71
  {detailsUrl && useDetailsPostMessage !== true && navigateToDetails === null &&
69
- <Button.Anchor
70
- href={detailsUrl}
71
- variant={detailsButtonVariant}
72
- size={buttonSize}
73
- >
74
- {detailsText}
75
- </Button.Anchor>
72
+ <Button.Anchor
73
+ href={detailsUrl}
74
+ variant={detailsButtonVariant}
75
+ size={buttonSize}
76
+ onClick={trackViewDetails}
77
+ >
78
+ {detailsText}
79
+ </Button.Anchor>
76
80
  }
77
81
  {useDetailsPostMessage === true && navigateToDetails === null &&
78
- <Button.Btn
79
- onClick={() => { window.parent.postMessage({ itemId: itemId, type: 'LISTING_ID' }, '*'); }}
80
- variant={detailsButtonVariant}
81
- size={buttonSize}
82
- >
83
- {detailsText}
84
- </Button.Btn>}
82
+ <Button.Btn
83
+ onClick={() => {trackViewDetails; window.parent.postMessage({ itemId: itemId, type: 'LISTING_ID' }, '*'); }}
84
+ variant={detailsButtonVariant}
85
+ size={buttonSize}
86
+ >
87
+ {detailsText}
88
+ </Button.Btn>}
85
89
  {applyUrl && !includeDialog && navigateToEasyApply == null &&
86
- <>
87
- <Button.Anchor
88
- href={applyUrl}
89
- variant={applyButtonVariant}
90
- size={buttonSize}
91
- >
92
- {applyText}
93
- </Button.Anchor>
94
- </>
90
+ <Button.Anchor
91
+ href={applyUrl}
92
+ variant={applyButtonVariant}
93
+ size={buttonSize}
94
+ onClick={trackApply}
95
+ >
96
+ {applyText}
97
+ </Button.Anchor>
95
98
  }
96
99
  {applyUrl && !includeDialog && navigateToEasyApply != null &&
97
- <>
98
- <Button.Btn
99
- onClick={() => { navigateToEasyApply(item); }}
100
- variant={applyButtonVariant}
101
- size={buttonSize}
102
- >
103
- {applyText}
104
- </Button.Btn>
105
- </>
100
+ <Button.Btn
101
+ onClick={() => { navigateToEasyApply(item); trackApply(); }}
102
+ variant={applyButtonVariant}
103
+ size={buttonSize}
104
+ >
105
+ {applyText}
106
+ </Button.Btn>
106
107
  }
107
108
  {applyUrl && includeDialog &&
108
- <ApplyDialog applyUrl={applyUrl} internalApplyLink={internalApplyLink} companyName={companyName}>
109
- {applyButton()}
110
- </ApplyDialog>
109
+ <ApplyDialog applyUrl={applyUrl} internalApplyLink={internalApplyLink} companyName={companyName}>
110
+ <Button.Anchor
111
+ variant={applyButtonVariant}
112
+ size={buttonSize}
113
+ onClick={trackApply}
114
+ >
115
+ {applyText}
116
+ </Button.Anchor>
117
+ </ApplyDialog>
111
118
  }
112
119
  </nav>
113
120
  );
@@ -6,6 +6,7 @@ import Button from '~/components/modules/buttons/default';
6
6
  import Icon from "~/components/modules/icon";
7
7
 
8
8
  import { useMapList } from '~/contexts/mapListContext';
9
+ import { useTrackEvent } from '~/contexts/trackEventContext';
9
10
  import { getStorageItem } from '~/util/localStorageUtil';
10
11
 
11
12
  const FilterCommute = ({ className }) => {
@@ -20,6 +21,7 @@ const FilterCommute = ({ className }) => {
20
21
  const inputRef = useRef(null);
21
22
  const { setCommuteLocation, commuteLocation } = useMapList();
22
23
  const [isCurrentLocation, setIsCurrentLocation] = useState(getStorageItem('isCurrentLocation', false));
24
+ const { trackEvent, eventTypes } = useTrackEvent();
23
25
 
24
26
  useEffect(() => {
25
27
  if (commuteLocation !== null && commuteLocation != '') return;
@@ -38,6 +40,7 @@ const FilterCommute = ({ className }) => {
38
40
  try {
39
41
  const results = await getGeocode({ address: val });
40
42
  const { lat, lng } = await getLatLng(results[0]);
43
+ trackEvent(eventTypes.COMMUTE_ORIGIN_ADDED, { commuteLocation: { lat, lng }, isCurrentLocation: false });
41
44
  setCommuteLocation({ lat, lng });
42
45
  } catch (error) {
43
46
  // no-op
@@ -51,10 +54,12 @@ const FilterCommute = ({ className }) => {
51
54
  }
52
55
  navigator.geolocation.getCurrentPosition(
53
56
  position => {
54
- setCommuteLocation({
57
+ const location = {
55
58
  lat: position.coords.latitude,
56
59
  lng: position.coords.longitude
57
- });
60
+ };
61
+ setCommuteLocation(location);
62
+ trackEvent(eventTypes.COMMUTE_ORIGIN_ADDED, { commuteLocation: location, isCurrentLocation: true });
58
63
  handleSelect("Current Location");
59
64
  },
60
65
  error => {