@abcagency/hc-ui-components 1.3.14 → 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 (166) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/dist/apis/hcApi.js +1 -1
  3. package/dist/apis/hcApi.js.map +1 -1
  4. package/dist/clientToken.js.map +1 -1
  5. package/dist/components/HireControlMap.js +15 -5
  6. package/dist/components/HireControlMap.js.map +1 -1
  7. package/dist/components/modules/accordions/MapAccordionItem.js +11 -1
  8. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  9. package/dist/components/modules/accordions/default.js.map +1 -1
  10. package/dist/components/modules/accordions/filterItem.js +2 -1
  11. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  12. package/dist/components/modules/accordions/filters.js +0 -3
  13. package/dist/components/modules/accordions/filters.js.map +1 -1
  14. package/dist/components/modules/buttons/button-group-apply.js +36 -15
  15. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  16. package/dist/components/modules/buttons/commute-pill.js.map +1 -1
  17. package/dist/components/modules/buttons/default.js.map +1 -1
  18. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  19. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
  20. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  21. package/dist/components/modules/cards/default.js.map +1 -1
  22. package/dist/components/modules/cards/filter.js.map +1 -1
  23. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  24. package/dist/components/modules/filter/commute.js +22 -6
  25. package/dist/components/modules/filter/commute.js.map +1 -1
  26. package/dist/components/modules/filter/index.js +7 -0
  27. package/dist/components/modules/filter/index.js.map +1 -1
  28. package/dist/components/modules/filter/item.js +16 -1
  29. package/dist/components/modules/filter/item.js.map +1 -1
  30. package/dist/components/modules/filter/location.js +1 -1
  31. package/dist/components/modules/filter/location.js.map +1 -1
  32. package/dist/components/modules/filter/points-of-interest.js.map +1 -1
  33. package/dist/components/modules/filter/radio-item.js +7 -0
  34. package/dist/components/modules/filter/radio-item.js.map +1 -1
  35. package/dist/components/modules/filter/search.js.map +1 -1
  36. package/dist/components/modules/filter/sort.js.map +1 -1
  37. package/dist/components/modules/grid.js.map +1 -1
  38. package/dist/components/modules/icon.js.map +1 -1
  39. package/dist/components/modules/jobListing/listing-details.js +6 -0
  40. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  41. package/dist/components/modules/maps/info-window-card.js.map +1 -1
  42. package/dist/components/modules/maps/info-window-content.js +20 -0
  43. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  44. package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
  45. package/dist/components/modules/maps/list/header-item.js.map +1 -1
  46. package/dist/components/modules/maps/list/header.js.map +1 -1
  47. package/dist/components/modules/maps/list/index.js +21 -12
  48. package/dist/components/modules/maps/list/index.js.map +1 -1
  49. package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
  50. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
  51. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
  52. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
  53. package/dist/components/modules/maps/list/list-item/index.js +12 -2
  54. package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
  55. package/dist/components/modules/maps/map-list.js.map +1 -1
  56. package/dist/components/modules/maps/map-marker.js +10 -0
  57. package/dist/components/modules/maps/map-marker.js.map +1 -1
  58. package/dist/components/modules/maps/map.js.map +1 -1
  59. package/dist/components/modules/maps/place-marker.js.map +1 -1
  60. package/dist/components/modules/maps/tabs.js.map +1 -1
  61. package/dist/constants/eventTypes.js +16 -0
  62. package/dist/constants/eventTypes.js.map +1 -0
  63. package/dist/constants/placeTypes.js.map +1 -1
  64. package/dist/contexts/mapContext.js +9 -27
  65. package/dist/contexts/mapContext.js.map +1 -1
  66. package/dist/contexts/mapListContext.js +57 -38
  67. package/dist/contexts/mapListContext.js.map +1 -1
  68. package/dist/contexts/placesContext.js.map +1 -1
  69. package/dist/contexts/trackEventContext.js +20 -0
  70. package/dist/contexts/trackEventContext.js.map +1 -0
  71. package/dist/hooks/useList.js +1 -13
  72. package/dist/hooks/useList.js.map +1 -1
  73. package/dist/services/apis/hcApi.js +1 -1
  74. package/dist/services/apis/hcApi.js.map +1 -1
  75. package/dist/services/clientToken.js.map +1 -1
  76. package/dist/services/configService.js.map +1 -1
  77. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  78. package/dist/services/listingAggregatorService.js +43 -16
  79. package/dist/services/listingAggregatorService.js.map +1 -1
  80. package/dist/services/listingEntityService.js.map +1 -1
  81. package/dist/services/listingService.js.map +1 -1
  82. package/dist/services/recruiterService.js.map +1 -1
  83. package/dist/util/filterUtil.js.map +1 -1
  84. package/dist/util/loading.js.map +1 -1
  85. package/dist/util/localStorageUtil.js.map +1 -1
  86. package/dist/util/mapIconUtil.js.map +1 -1
  87. package/dist/util/mapUtil.js.map +1 -1
  88. package/dist/util/sortUtil.js.map +1 -1
  89. package/dist/util/stringUtils.js.map +1 -1
  90. package/jsconfig.json +7 -7
  91. package/package.json +60 -60
  92. package/postcss.config.js +13 -13
  93. package/preset.default.js +15 -15
  94. package/rollup.config.mjs +88 -87
  95. package/src/apis/hcApi.js +93 -93
  96. package/src/clientToken.js +9 -9
  97. package/src/components/HireControlMap.js +129 -124
  98. package/src/components/modules/accordions/MapAccordionItem.js +74 -72
  99. package/src/components/modules/accordions/default.js +171 -171
  100. package/src/components/modules/accordions/filterItem.js +55 -53
  101. package/src/components/modules/accordions/filters.js +47 -47
  102. package/src/components/modules/buttons/button-group-apply.js +123 -116
  103. package/src/components/modules/buttons/commute-pill.js +22 -22
  104. package/src/components/modules/buttons/default.js +194 -194
  105. package/src/components/modules/buttons/items-pill.js +35 -35
  106. package/src/components/modules/buttons/pill-wrapper.js +27 -27
  107. package/src/components/modules/buttons/show-all-button.js +20 -20
  108. package/src/components/modules/cards/default.js +167 -167
  109. package/src/components/modules/cards/filter.js +56 -56
  110. package/src/components/modules/dialogs/apply-dialog.js +48 -48
  111. package/src/components/modules/filter/commute.js +154 -149
  112. package/src/components/modules/filter/index.js +89 -87
  113. package/src/components/modules/filter/item.js +87 -76
  114. package/src/components/modules/filter/location.js +71 -71
  115. package/src/components/modules/filter/points-of-interest.js +44 -44
  116. package/src/components/modules/filter/radio-item.js +57 -53
  117. package/src/components/modules/filter/search.js +92 -92
  118. package/src/components/modules/filter/sort.js +83 -83
  119. package/src/components/modules/grid.js +54 -54
  120. package/src/components/modules/icon.js +33 -33
  121. package/src/components/modules/jobListing/listing-details.js +99 -95
  122. package/src/components/modules/maps/info-window-card.js +17 -17
  123. package/src/components/modules/maps/info-window-content.js +81 -74
  124. package/src/components/modules/maps/list/field-mapper.js +112 -112
  125. package/src/components/modules/maps/list/header-item.js +91 -91
  126. package/src/components/modules/maps/list/header.js +47 -47
  127. package/src/components/modules/maps/list/index.js +112 -107
  128. package/src/components/modules/maps/list/item-expand-card/index.js +22 -22
  129. package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +50 -50
  130. package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +68 -68
  131. package/src/components/modules/maps/list/item-expand-card/recruiter-headshot.js +22 -22
  132. package/src/components/modules/maps/list/list-item/index.js +135 -133
  133. package/src/components/modules/maps/map-list.js +74 -74
  134. package/src/components/modules/maps/map-marker.js +88 -86
  135. package/src/components/modules/maps/map.js +230 -230
  136. package/src/components/modules/maps/place-marker.js +41 -41
  137. package/src/components/modules/maps/tabs.js +81 -81
  138. package/src/constants/eventTypes.js +13 -0
  139. package/src/constants/placeTypes.js +8 -8
  140. package/src/contexts/mapContext.js +101 -115
  141. package/src/contexts/mapListContext.js +242 -222
  142. package/src/contexts/placesContext.js +102 -102
  143. package/src/contexts/trackEventContext.js +14 -0
  144. package/src/hooks/useList.js +89 -100
  145. package/src/index.js +3 -3
  146. package/src/services/configService.js +16 -16
  147. package/src/services/googlePlacesNearbyService.js +33 -33
  148. package/src/services/listingAggregatorService.js +50 -45
  149. package/src/services/listingEntityService.js +15 -15
  150. package/src/services/listingService.js +26 -26
  151. package/src/services/recruiterService.js +17 -17
  152. package/src/styles/index.css +23 -23
  153. package/src/util/arrayUtil.js +3 -3
  154. package/src/util/fieldMapper.js +22 -22
  155. package/src/util/filterUtil.js +195 -195
  156. package/src/util/loading.js +17 -17
  157. package/src/util/localStorageUtil.js +26 -26
  158. package/src/util/mapIconUtil.js +180 -180
  159. package/src/util/mapUtil.js +91 -91
  160. package/src/util/sortUtil.js +32 -32
  161. package/src/util/stringUtils.js +6 -6
  162. package/src/util/urlFilterUtil.js +90 -90
  163. package/tailwind.config.js +126 -126
  164. package/.editorconfig +0 -12
  165. package/.eslintrc +0 -105
  166. package/.prettierignore +0 -3
@@ -1,68 +1,68 @@
1
- import React from 'react';
2
- import { twMerge } from 'tailwind-merge';
3
-
4
- const RecruiterDetails = ({
5
- contactNav,
6
- className,
7
- children
8
- }) => {
9
- return (
10
- <div
11
- className={twMerge`
12
- hc-grow
13
- ${className ?? ''}
14
- `}
15
- >
16
- {children}
17
-
18
- {contactNav &&
19
- <div className="hc-inline-flex">
20
- {contactNav}
21
- </div>
22
- }
23
- </div>
24
- );
25
- };
26
-
27
- export const Title = ({
28
- as = 'h4',
29
- className,
30
- children
31
- }) => {
32
- const Container = as;
33
-
34
- return (
35
- <Container
36
- className={twMerge`
37
- hc-text-base hc-font-medium
38
- ${className ?? ''}
39
- `}
40
- >
41
- {children}
42
- </Container>
43
- );
44
- };
45
-
46
- export const Text = ({
47
- as = 'p',
48
- className,
49
- children
50
- }) => {
51
- const Container = as;
52
-
53
- return (
54
- <Container
55
- className={twMerge`
56
- hc-text-sm hc-text-uiText/60
57
- ${className ?? ''}
58
- `}
59
- >
60
- {children}
61
- </Container>
62
- );
63
- };
64
-
65
- RecruiterDetails.Title = Title;
66
- RecruiterDetails.Text = Text;
67
-
68
- export default RecruiterDetails;
1
+ import React from 'react';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ const RecruiterDetails = ({
5
+ contactNav,
6
+ className,
7
+ children
8
+ }) => {
9
+ return (
10
+ <div
11
+ className={twMerge`
12
+ hc-grow
13
+ ${className ?? ''}
14
+ `}
15
+ >
16
+ {children}
17
+
18
+ {contactNav &&
19
+ <div className="hc-inline-flex">
20
+ {contactNav}
21
+ </div>
22
+ }
23
+ </div>
24
+ );
25
+ };
26
+
27
+ export const Title = ({
28
+ as = 'h4',
29
+ className,
30
+ children
31
+ }) => {
32
+ const Container = as;
33
+
34
+ return (
35
+ <Container
36
+ className={twMerge`
37
+ hc-text-base hc-font-medium
38
+ ${className ?? ''}
39
+ `}
40
+ >
41
+ {children}
42
+ </Container>
43
+ );
44
+ };
45
+
46
+ export const Text = ({
47
+ as = 'p',
48
+ className,
49
+ children
50
+ }) => {
51
+ const Container = as;
52
+
53
+ return (
54
+ <Container
55
+ className={twMerge`
56
+ hc-text-sm hc-text-uiText/60
57
+ ${className ?? ''}
58
+ `}
59
+ >
60
+ {children}
61
+ </Container>
62
+ );
63
+ };
64
+
65
+ RecruiterDetails.Title = Title;
66
+ RecruiterDetails.Text = Text;
67
+
68
+ export default RecruiterDetails;
@@ -1,22 +1,22 @@
1
- import React from 'react';
2
-
3
- const RecruiterHeadshot = ({
4
- image,
5
- alt,
6
- className,
7
- imageClassName
8
- }) => {
9
- return (
10
- <div className={className ?? ''}>
11
- <img
12
- src={image}
13
- width="96"
14
- height="96"
15
- alt={alt}
16
- className={imageClassName ?? ''}
17
- />
18
- </div>
19
- );
20
- };
21
-
22
- export default RecruiterHeadshot;
1
+ import React from 'react';
2
+
3
+ const RecruiterHeadshot = ({
4
+ image,
5
+ alt,
6
+ className,
7
+ imageClassName
8
+ }) => {
9
+ return (
10
+ <div className={className ?? ''}>
11
+ <img
12
+ src={image}
13
+ width="96"
14
+ height="96"
15
+ alt={alt}
16
+ className={imageClassName ?? ''}
17
+ />
18
+ </div>
19
+ );
20
+ };
21
+
22
+ export default RecruiterHeadshot;
@@ -1,133 +1,135 @@
1
- import React, { forwardRef } from 'react';
2
-
3
- import Grid from '~/components/modules/grid';
4
- import Icon from '~/components/modules/icon';
5
- import FieldMapper from '~/components/modules/maps/list/field-mapper';
6
-
7
- import { useMapList } from '~/contexts/mapListContext';
8
-
9
- const ListItem = forwardRef(
10
- (
11
- {
12
- isActive,
13
- bodyClassName,
14
- className,
15
- item,
16
- fieldsShown,
17
- specialFeatures,
18
- onItemSelected,
19
- showMap,
20
- setMobileTab,
21
- favorites,
22
- setFavorites,
23
- ...props
24
- },
25
- ref
26
- ) => {
27
- const { siteConfig } = useMapList();
28
- const mapPinColor = siteConfig.colors.primary.replace("#", "");
29
-
30
- const handleClick = () => {
31
- if (onItemSelected) {
32
- onItemSelected(item);
33
- }
34
- };
35
-
36
- let isFavorite = favorites.includes(item.id);
37
-
38
- const handleFavouriteClick = event => {
39
- event.stopPropagation();
40
- let updatedFavorites;
41
- if (isFavorite) {
42
- updatedFavorites = favorites.filter(fav => fav !== item.id);
43
- } else {
44
- updatedFavorites = [...favorites, item.id];
45
- }
46
- isFavorite = !isFavorite;
47
- setFavorites(updatedFavorites);
48
-
49
- };
50
-
51
- return (
52
- <button
53
- ref={ref}
54
- onClick={handleClick}
55
- className={`
56
- hc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5
57
- ${isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white"}
58
- ${className ?? ""}
59
- `}
60
- {...props}
61
- >
62
- <Grid
63
- columns="hc-grid-flow-col hc-auto-cols-fr"
64
- gap="hc-gap-2"
65
- isAnimated={false}
66
- className={`
67
- hc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm
68
- ${bodyClassName ?? ""}
69
- `}
70
- >
71
- <Grid.Item className="hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5">
72
- <span className="hc-sr-only">Expand row</span>
73
- <Icon
74
- icon="fluent-emoji-high-contrast:plus"
75
- size="hc-size-2.5"
76
- className={`
77
- hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100
78
- ${isActive ? "hc-opacity-100 hc-rotate-45" : ""}
79
- `}
80
- />
81
-
82
- </Grid.Item>
83
-
84
- <FieldMapper
85
- item={item}
86
- fieldsShown={fieldsShown}
87
- specialFeatures={specialFeatures}
88
- isFavorite={isFavorite}
89
- handleFavouriteClick={handleFavouriteClick}
90
- />
91
- <Grid.Item
92
- key={"favorites"}
93
- className="hc-hidden md:hc-block hc-col-span-1"
94
- >
95
- <Icon
96
- icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
97
- size="hc-size-3.5"
98
- iconClasses={isFavorite ? "hc-text-primary" : ""}
99
- title={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}
100
- className={`
101
- hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100"
102
- `}
103
- onClick={e => handleFavouriteClick(e)}
104
- />
105
- </Grid.Item>
106
- </Grid>
107
-
108
- {showMap && (
109
- <div onClick={() => { setMobileTab("mapTab"); handleClick(); }} className="md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm">
110
- <img
111
- src={`https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails?.latitude},${item.mapDetails?.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails?.latitude},${item.mapDetails?.longitude}&key=${process.env.GOOGLE_MAPS_API_KEY}`}
112
- alt={`Map of location for ${item.fields.position}`}
113
- className="hc-w-full hc-h-full hc-object-cover"
114
- />
115
- </div>
116
- )}
117
- </button>
118
- );
119
- }
120
- );
121
-
122
- ListItem.displayName = "ListItem";
123
-
124
- export default React.memo(ListItem, (prevProps, nextProps) => {
125
- return (
126
- (prevProps.isActive === nextProps.isActive ||
127
- prevProps.isActive !== nextProps.isActive) &&
128
- prevProps.bodyClassName === nextProps.bodyClassName &&
129
- prevProps.className === nextProps.className &&
130
- prevProps.fieldsShown === nextProps.fieldsShown &&
131
- prevProps.item.id === nextProps.item.id
132
- );
133
- });
1
+ import React, { forwardRef } from 'react';
2
+
3
+ import Grid from '~/components/modules/grid';
4
+ import Icon from '~/components/modules/icon';
5
+ import FieldMapper from '~/components/modules/maps/list/field-mapper';
6
+
7
+ import { useMapList } from '~/contexts/mapListContext';
8
+ import { useTrackEvent } from '~/contexts/trackEventContext';
9
+
10
+ const ListItem = forwardRef(
11
+ (
12
+ {
13
+ isActive,
14
+ bodyClassName,
15
+ className,
16
+ item,
17
+ fieldsShown,
18
+ specialFeatures,
19
+ onItemSelected,
20
+ showMap,
21
+ setMobileTab,
22
+ favorites,
23
+ setFavorites,
24
+ ...props
25
+ },
26
+ ref
27
+ ) => {
28
+ const { siteConfig } = useMapList();
29
+ const { trackEvent, eventTypes } = useTrackEvent();
30
+ const mapPinColor = siteConfig.colors.primary.replace("#", "");
31
+
32
+ const handleClick = () => {
33
+ if (onItemSelected) {
34
+ onItemSelected(item);
35
+ }
36
+ };
37
+
38
+ let isFavorite = favorites.includes(item.id);
39
+
40
+ const handleFavouriteClick = event => {
41
+ event.stopPropagation();
42
+ let updatedFavorites;
43
+ if (isFavorite) {
44
+ updatedFavorites = favorites.filter(fav => fav !== item.id);
45
+ } else {
46
+ trackEvent(eventTypes.FAVORITE_SELECTED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
47
+ updatedFavorites = [...favorites, item.id];
48
+ }
49
+ isFavorite = !isFavorite;
50
+ setFavorites(updatedFavorites);
51
+ };
52
+
53
+ return (
54
+ <button
55
+ ref={ref}
56
+ onClick={handleClick}
57
+ className={`
58
+ hc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5
59
+ ${isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white"}
60
+ ${className ?? ""}
61
+ `}
62
+ {...props}
63
+ >
64
+ <Grid
65
+ columns="hc-grid-flow-col hc-auto-cols-fr"
66
+ gap="hc-gap-2"
67
+ isAnimated={false}
68
+ className={`
69
+ hc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm
70
+ ${bodyClassName ?? ""}
71
+ `}
72
+ >
73
+ <Grid.Item className="hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5">
74
+ <span className="hc-sr-only">Expand row</span>
75
+ <Icon
76
+ icon="fluent-emoji-high-contrast:plus"
77
+ size="hc-size-2.5"
78
+ className={`
79
+ hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100
80
+ ${isActive ? "hc-opacity-100 hc-rotate-45" : ""}
81
+ `}
82
+ />
83
+
84
+ </Grid.Item>
85
+
86
+ <FieldMapper
87
+ item={item}
88
+ fieldsShown={fieldsShown}
89
+ specialFeatures={specialFeatures}
90
+ isFavorite={isFavorite}
91
+ handleFavouriteClick={handleFavouriteClick}
92
+ />
93
+ <Grid.Item
94
+ key={"favorites"}
95
+ className="hc-hidden md:hc-block hc-col-span-1"
96
+ >
97
+ <Icon
98
+ icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
99
+ size="hc-size-3.5"
100
+ iconClasses={isFavorite ? "hc-text-primary" : ""}
101
+ title={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}
102
+ className={`
103
+ hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100"
104
+ `}
105
+ onClick={e => handleFavouriteClick(e)}
106
+ />
107
+ </Grid.Item>
108
+ </Grid>
109
+
110
+ {showMap && (
111
+ <div onClick={() => { setMobileTab("mapTab"); handleClick(); }} className="md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm">
112
+ <img
113
+ src={`https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails?.latitude},${item.mapDetails?.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails?.latitude},${item.mapDetails?.longitude}&key=${process.env.GOOGLE_MAPS_API_KEY}`}
114
+ alt={`Map of location for ${item.fields.position}`}
115
+ className="hc-w-full hc-h-full hc-object-cover"
116
+ />
117
+ </div>
118
+ )}
119
+ </button>
120
+ );
121
+ }
122
+ );
123
+
124
+ ListItem.displayName = "ListItem";
125
+
126
+ export default React.memo(ListItem, (prevProps, nextProps) => {
127
+ return (
128
+ (prevProps.isActive === nextProps.isActive ||
129
+ prevProps.isActive !== nextProps.isActive) &&
130
+ prevProps.bodyClassName === nextProps.bodyClassName &&
131
+ prevProps.className === nextProps.className &&
132
+ prevProps.fieldsShown === nextProps.fieldsShown &&
133
+ prevProps.item.id === nextProps.item.id
134
+ );
135
+ });
@@ -1,74 +1,74 @@
1
- import React from 'react';
2
-
3
- import List from '~/components/modules/maps/list';
4
- import Map from '~/components/modules/maps/map';
5
- import Tabs from '~/components/modules/maps/tabs';
6
- import Filter from '~/components/modules/filter';
7
-
8
- const MapList = ({
9
- loading = false,
10
- mapDetails,
11
- markerConfigs,
12
- itemExpandedContent,
13
- fieldsShown,
14
- specialFeatures,
15
- fieldNames,
16
- showMap,
17
- placeMappings
18
- }) => {
19
-
20
- const listProps = {
21
- fieldsShown: fieldsShown,
22
- fieldNames: fieldNames,
23
- itemExpandedContent: itemExpandedContent,
24
- loading: loading,
25
- showMap: showMap,
26
- specialFeatures: specialFeatures
27
- };
28
-
29
- const mapProps = {
30
- mapDetails: mapDetails,
31
- markerConfigs: markerConfigs,
32
- placeMappings: placeMappings,
33
- clusterGridSize: 60,
34
- showMap: showMap
35
- };
36
-
37
- // useEffect(() => {
38
- // if (selectedItem !== null) {
39
- // trackEvent("Map", "View Location", selectedItem[titlePropName]);
40
- // }
41
- // // eslint-disable-next-line react-hooks/exhaustive-deps
42
- // }, []);
43
- const map = <Map {...mapProps} />;
44
- return (
45
- <>
46
- <div
47
- className={`
48
- ${showMap == false ? "md:hc-grid-rows-[100vh]" : "md:hc-grid-rows-[50vh_50vh]"}
49
- md:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100
50
- `}
51
- >
52
- <div>
53
- <List {...listProps} />
54
- </div>
55
- <div>{showMap && map}</div>
56
- </div>
57
- <div className="md:hc-hidden">
58
- <Tabs
59
- showMap={showMap}
60
- list={<List {...listProps} />}
61
- map={!loading && showMap && map}
62
- filter={
63
- <Filter
64
- showMap={showMap}
65
- className="md:hc-hidden"
66
- />
67
- }
68
- />
69
- </div>
70
- </>
71
- );
72
- };
73
-
74
- export default MapList;
1
+ import React from 'react';
2
+
3
+ import List from '~/components/modules/maps/list';
4
+ import Map from '~/components/modules/maps/map';
5
+ import Tabs from '~/components/modules/maps/tabs';
6
+ import Filter from '~/components/modules/filter';
7
+
8
+ const MapList = ({
9
+ loading = false,
10
+ mapDetails,
11
+ markerConfigs,
12
+ itemExpandedContent,
13
+ fieldsShown,
14
+ specialFeatures,
15
+ fieldNames,
16
+ showMap,
17
+ placeMappings
18
+ }) => {
19
+
20
+ const listProps = {
21
+ fieldsShown: fieldsShown,
22
+ fieldNames: fieldNames,
23
+ itemExpandedContent: itemExpandedContent,
24
+ loading: loading,
25
+ showMap: showMap,
26
+ specialFeatures: specialFeatures
27
+ };
28
+
29
+ const mapProps = {
30
+ mapDetails: mapDetails,
31
+ markerConfigs: markerConfigs,
32
+ placeMappings: placeMappings,
33
+ clusterGridSize: 60,
34
+ showMap: showMap
35
+ };
36
+
37
+ // useEffect(() => {
38
+ // if (selectedItem !== null) {
39
+ // trackEvent("Map", "View Location", selectedItem[titlePropName]);
40
+ // }
41
+ // // eslint-disable-next-line react-hooks/exhaustive-deps
42
+ // }, []);
43
+ const map = <Map {...mapProps} />;
44
+ return (
45
+ <>
46
+ <div
47
+ className={`
48
+ ${showMap == false ? "md:hc-grid-rows-[100vh]" : "md:hc-grid-rows-[50vh_50vh]"}
49
+ md:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100
50
+ `}
51
+ >
52
+ <div>
53
+ <List {...listProps} />
54
+ </div>
55
+ <div>{showMap && map}</div>
56
+ </div>
57
+ <div className="md:hc-hidden">
58
+ <Tabs
59
+ showMap={showMap}
60
+ list={<List {...listProps} />}
61
+ map={!loading && showMap && map}
62
+ filter={
63
+ <Filter
64
+ showMap={showMap}
65
+ className="md:hc-hidden"
66
+ />
67
+ }
68
+ />
69
+ </div>
70
+ </>
71
+ );
72
+ };
73
+
74
+ export default MapList;