@abcagency/hc-ui-components 1.3.58 → 1.3.60

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 (139) hide show
  1. package/dist/components/HireControlMap.js +11 -1
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  4. package/dist/components/containers/filter/commute-container.js +1 -1
  5. package/dist/components/containers/filter/commute-container.js.map +1 -1
  6. package/dist/components/containers/filter/filter-container.js.map +1 -1
  7. package/dist/components/containers/filter/filter-item-container.js.map +1 -1
  8. package/dist/components/containers/filter/location-container.js.map +1 -1
  9. package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
  10. package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
  11. package/dist/components/containers/filter/search-container.js.map +1 -1
  12. package/dist/components/containers/jobListing/listing-details-container.js +5 -1
  13. package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
  14. package/dist/components/containers/list/item-list-container.js.map +1 -1
  15. package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
  16. package/dist/components/containers/maps/map-container.js +1 -1
  17. package/dist/components/containers/maps/map-list-container.js.map +1 -1
  18. package/dist/components/containers/maps/map-marker-container.js +1 -1
  19. package/dist/components/containers/maps/map-marker-container.js.map +1 -1
  20. package/dist/components/modules/accordions/default.js +2 -2
  21. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  22. package/dist/components/modules/accordions/filters.js.map +1 -1
  23. package/dist/components/modules/buttons/button-group-apply.js +48 -54
  24. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  25. package/dist/components/modules/buttons/default.js +2 -2
  26. package/dist/components/modules/cards/default.js +2 -2
  27. package/dist/components/modules/dialogs/apply-dialog.js +1 -1
  28. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  29. package/dist/components/modules/filter/commute.js +2 -2
  30. package/dist/components/modules/filter/commute.js.map +1 -1
  31. package/dist/components/modules/filter/index.js.map +1 -1
  32. package/dist/components/modules/filter/location.js.map +1 -1
  33. package/dist/components/modules/filter/radio-item.js.map +1 -1
  34. package/dist/components/modules/filter/search.js.map +1 -1
  35. package/dist/components/modules/filter/sort.js +2 -2
  36. package/dist/components/modules/grid.js +1 -1
  37. package/dist/components/modules/icon.js +1 -1
  38. package/dist/components/modules/jobListing/listing-details.js +8 -7
  39. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  40. package/dist/components/modules/list/field-mapper.js.map +1 -1
  41. package/dist/components/modules/list/header-item.js.map +1 -1
  42. package/dist/components/modules/list/header.js +1 -1
  43. package/dist/components/modules/list/item-expand-card/index.js +1 -1
  44. package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
  45. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js +38 -38
  46. package/dist/components/modules/list/item-expand-card/recruiter-details.js +40 -40
  47. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js +20 -20
  48. package/dist/components/modules/list/item-list.js +3 -3
  49. package/dist/components/modules/list/item-list.js.map +1 -1
  50. package/dist/components/modules/list/list-item/list-item.js.map +1 -1
  51. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  52. package/dist/components/modules/maps/map-list.js.map +1 -1
  53. package/dist/components/modules/maps/map-marker.js +1 -1
  54. package/dist/components/modules/maps/map-marker.js.map +1 -1
  55. package/dist/components/modules/maps/map.js +1 -1
  56. package/dist/components/modules/maps/place-marker.js +1 -1
  57. package/dist/components/modules/maps/tabs.js +1 -1
  58. package/dist/constants/eventTypes.js +1 -0
  59. package/dist/constants/eventTypes.js.map +1 -1
  60. package/dist/contexts/mapContext.js.map +1 -1
  61. package/dist/contexts/mapListContext.js +3 -1
  62. package/dist/contexts/mapListContext.js.map +1 -1
  63. package/dist/contexts/placesContext.js.map +1 -1
  64. package/dist/contexts/themeContext.js.map +1 -1
  65. package/dist/services/configService.js.map +1 -1
  66. package/dist/services/listingEntityService.js.map +1 -1
  67. package/dist/services/listingService.js.map +1 -1
  68. package/dist/services/recruiterService.js.map +1 -1
  69. package/dist/types/components/modules/buttons/button-group-apply.d.ts +4 -4
  70. package/dist/types/components/modules/jobListing/listing-details.d.ts +3 -1
  71. package/dist/types/constants/eventTypes.d.ts +1 -0
  72. package/dist/types/contexts/mapListContext.d.ts +4 -0
  73. package/dist/util/filterUtil.js +3 -3
  74. package/dist/util/filterUtil.js.map +1 -1
  75. package/dist/util/mapIconUtil.js.map +1 -1
  76. package/dist/util/mapUtil.js.map +1 -1
  77. package/package.json +90 -90
  78. package/src/.editorconfig +12 -12
  79. package/src/bundleIndex.js +14 -14
  80. package/src/components/HireControlMap.js +148 -142
  81. package/src/components/containers/accordions/filter-item-container.js +83 -83
  82. package/src/components/containers/filter/commute-container.js +89 -89
  83. package/src/components/containers/filter/filter-container.js +76 -76
  84. package/src/components/containers/filter/filter-item-container.js +117 -117
  85. package/src/components/containers/filter/location-container.js +45 -45
  86. package/src/components/containers/filter/points-of-interest-container.js +33 -33
  87. package/src/components/containers/filter/points-of-interest-radio-item-container.js +35 -35
  88. package/src/components/containers/filter/search-container.js +61 -61
  89. package/src/components/containers/jobListing/listing-details-container.js +3 -1
  90. package/src/components/containers/list/item-list-container.tsx +81 -81
  91. package/src/components/containers/maps/info-window-content-container.js +53 -53
  92. package/src/components/containers/maps/map-list-container.js +50 -50
  93. package/src/components/containers/maps/map-marker-container.js +78 -78
  94. package/src/components/modules/accordions/filterItem.js +27 -27
  95. package/src/components/modules/accordions/filters.js +32 -32
  96. package/src/components/modules/buttons/button-group-apply.js +115 -135
  97. package/src/components/modules/dialogs/apply-dialog.js +48 -48
  98. package/src/components/modules/filter/commute.js +108 -108
  99. package/src/components/modules/filter/index.js +55 -55
  100. package/src/components/modules/filter/location.js +51 -51
  101. package/src/components/modules/filter/radio-item.js +42 -42
  102. package/src/components/modules/filter/search.js +79 -79
  103. package/src/components/modules/jobListing/listing-details.js +110 -108
  104. package/src/components/modules/list/field-mapper.js +130 -130
  105. package/src/components/modules/list/header-item.js +92 -92
  106. package/src/components/modules/list/item-expand-card/index.js +22 -22
  107. package/src/components/modules/list/item-list.tsx +117 -117
  108. package/src/components/modules/list/list-item/list-item.js +130 -130
  109. package/src/components/modules/maps/info-window-content.js +64 -64
  110. package/src/components/modules/maps/map-list.js +38 -38
  111. package/src/components/modules/maps/map-marker.js +29 -29
  112. package/src/constants/eventTypes.js +15 -14
  113. package/src/contexts/mapContext.tsx +129 -129
  114. package/src/contexts/mapListContext.tsx +326 -318
  115. package/src/contexts/placesContext.js +102 -102
  116. package/src/contexts/themeContext.js +40 -40
  117. package/src/services/configService.ts +16 -16
  118. package/src/services/listingEntityService.ts +16 -16
  119. package/src/services/listingService.ts +40 -40
  120. package/src/services/recruiterService.ts +18 -18
  121. package/src/styles/bundle.css +268 -268
  122. package/src/styles/index.css +33 -33
  123. package/src/types/Address.ts +7 -7
  124. package/src/types/ContentSection.ts +9 -9
  125. package/src/types/GetListingParams.ts +8 -8
  126. package/src/types/LatLng.ts +4 -4
  127. package/src/types/ListingEntity.ts +11 -11
  128. package/src/types/ListingFields.ts +25 -25
  129. package/src/types/Listings.ts +32 -32
  130. package/src/types/Recruiter.ts +9 -9
  131. package/src/types/SimilarListing.ts +24 -24
  132. package/src/types/config/Colors.ts +8 -8
  133. package/src/types/config/MapConfig.ts +31 -31
  134. package/src/types/config/PointsOfInterestConfig.ts +13 -13
  135. package/src/types/config/SearchConfig.ts +4 -4
  136. package/src/util/filterUtil.js +2 -1
  137. package/src/util/mapIconUtil.js +180 -180
  138. package/src/util/mapUtil.js +92 -92
  139. package/dist/types/contexts/themeContext.d.ts +0 -11
@@ -1,108 +1,110 @@
1
- import React from 'react';
2
- import RecruiterHeadshot from '~/components/modules/list/item-expand-card/recruiter-headshot';
3
- import RecruiterDetails from '~/components/modules/list/item-expand-card/recruiter-details';
4
- import RecruiterContactNav from '~/components/modules/list/item-expand-card/recruiter-contact-nav';
5
- import ApplyButtonGroup from '~/components/modules/buttons/button-group-apply';
6
- import CommutePill from '~/components/modules/buttons/commute-pill';
7
-
8
- const ListingDetails = ({
9
- item,
10
- recruiter,
11
- travelTime,
12
- useDetailsPostMessage,
13
- navigateToDetails,
14
- navigateToEasyApply,
15
- Link,
16
- linkFormat,
17
- useApplyDialog,
18
- internalApplyLink,
19
- companyName,
20
- jobsDomain,
21
- trackEvent,
22
- eventTypes
23
- }) => {
24
- if (!item) {
25
- return null;
26
- }
27
-
28
- let matchingRecruiter = recruiter;
29
- return (
30
- <div className="hc-w-full">
31
- <div className="hc-grow hc-flex hc-flex-wrap hc-items-center hc-gap-4">
32
- {/* {matchingRecruiter?.headshot && (
33
- <RecruiterHeadshot
34
- image={`${matchingRecruiter.headshot.includes("http") ? '' :'https:'}${matchingRecruiter.headshot}`}
35
- alt={matchingRecruiter?.firstName}
36
- className="hc-bg-gray-300"
37
- />
38
- )}
39
- {matchingRecruiter && (
40
- <RecruiterDetails
41
- contactNav={
42
- <RecruiterContactNav>
43
- {matchingRecruiter?.mobilePhone && (
44
- <RecruiterContactNav.Button
45
- href={`tel:${matchingRecruiter.mobilePhone}`}
46
- title={`Call ${matchingRecruiter.mobilePhone}`}
47
- icon="fluent:phone-32-regular"
48
- />
49
- )}
50
- {matchingRecruiter?.email && (
51
- <RecruiterContactNav.Button
52
- href={`mailto:${matchingRecruiter.email}`}
53
- title={`email ${matchingRecruiter.email}`}
54
- icon="bi:envelope-at"
55
- />
56
- )}
57
- {matchingRecruiter?.linkedIn && (
58
- <RecruiterContactNav.Button
59
- href={matchingRecruiter.linkedIn}
60
- title="LinkedIn"
61
- icon="ant-design:linkedin-outlined"
62
- />
63
- )}
64
- </RecruiterContactNav>
65
- }
66
- >
67
- {matchingRecruiter?.firstName || matchingRecruiter?.lastName && (
68
- <RecruiterDetails.Title>
69
- {`${matchingRecruiter?.firstName} ${matchingRecruiter?.lastName}`}
70
- </RecruiterDetails.Title>
71
- )}
72
- {item.details?.recruiter?.title && (
73
- <RecruiterDetails.Text>
74
- {item.details.recruiter.title}
75
- </RecruiterDetails.Text>
76
- )}
77
- </RecruiterDetails>
78
- )} */}
79
- <ApplyButtonGroup
80
- useDetailsPostMessage={useDetailsPostMessage}
81
- navigateToDetails={navigateToDetails}
82
- navigateToEasyApply={navigateToEasyApply}
83
- Link={Link}
84
- linkFormat={linkFormat}
85
- includeDialog={useApplyDialog}
86
- internalApplyLink={internalApplyLink}
87
- companyName={companyName}
88
- applyUrl={item?.applyUrl}
89
- itemId={item.id}
90
- item={item}
91
- trackEvent={trackEvent}
92
- eventTypes={eventTypes}
93
- detailsUrl={item.useClientJobUrl ? item?.detailsUrl : `${jobsDomain}${item.id}`}
94
- className={`
95
- 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
96
- ${matchingRecruiter ? "lg:hc-flex-col lg:hc-w-auto" : "lg:hc-flex-row"}
97
- `}
98
- />
99
- </div>
100
- <div className="hc-w-full">
101
- <CommutePill travelTime={travelTime} className="hc-ml-0" />
102
- </div>
103
- </div>
104
- );
105
- };
106
-
107
- export default ListingDetails;
108
-
1
+ import React from 'react';
2
+ import RecruiterHeadshot from '~/components/modules/list/item-expand-card/recruiter-headshot';
3
+ import RecruiterDetails from '~/components/modules/list/item-expand-card/recruiter-details';
4
+ import RecruiterContactNav from '~/components/modules/list/item-expand-card/recruiter-contact-nav';
5
+ import ApplyButtonGroup from '~/components/modules/buttons/button-group-apply';
6
+ import CommutePill from '~/components/modules/buttons/commute-pill';
7
+
8
+ const ListingDetails = ({
9
+ item,
10
+ recruiter,
11
+ travelTime,
12
+ useDetailsPostMessage,
13
+ navigateToDetails,
14
+ navigateToEasyApply,
15
+ Link,
16
+ linkFormat,
17
+ easyApplyUrl,
18
+ easyApplyText,
19
+ useApplyDialog,
20
+ internalApplyLink,
21
+ companyName,
22
+ jobsDomain,
23
+ trackEvent,
24
+ eventTypes
25
+ }) => {
26
+ if (!item) {
27
+ return null;
28
+ }
29
+
30
+ let matchingRecruiter = recruiter;
31
+ return (
32
+ <div className="hc-w-full">
33
+ <div className="hc-grow hc-flex hc-flex-wrap hc-items-center hc-gap-4">
34
+ {/* {matchingRecruiter?.headshot && (
35
+ <RecruiterHeadshot
36
+ image={`${matchingRecruiter.headshot.includes("http") ? '' :'https:'}${matchingRecruiter.headshot}`}
37
+ alt={matchingRecruiter?.firstName}
38
+ className="hc-bg-gray-300"
39
+ />
40
+ )}
41
+ {matchingRecruiter && (
42
+ <RecruiterDetails
43
+ contactNav={
44
+ <RecruiterContactNav>
45
+ {matchingRecruiter?.mobilePhone && (
46
+ <RecruiterContactNav.Button
47
+ href={`tel:${matchingRecruiter.mobilePhone}`}
48
+ title={`Call ${matchingRecruiter.mobilePhone}`}
49
+ icon="fluent:phone-32-regular"
50
+ />
51
+ )}
52
+ {matchingRecruiter?.email && (
53
+ <RecruiterContactNav.Button
54
+ href={`mailto:${matchingRecruiter.email}`}
55
+ title={`email ${matchingRecruiter.email}`}
56
+ icon="bi:envelope-at"
57
+ />
58
+ )}
59
+ {matchingRecruiter?.linkedIn && (
60
+ <RecruiterContactNav.Button
61
+ href={matchingRecruiter.linkedIn}
62
+ title="LinkedIn"
63
+ icon="ant-design:linkedin-outlined"
64
+ />
65
+ )}
66
+ </RecruiterContactNav>
67
+ }
68
+ >
69
+ {matchingRecruiter?.firstName || matchingRecruiter?.lastName && (
70
+ <RecruiterDetails.Title>
71
+ {`${matchingRecruiter?.firstName} ${matchingRecruiter?.lastName}`}
72
+ </RecruiterDetails.Title>
73
+ )}
74
+ {item.details?.recruiter?.title && (
75
+ <RecruiterDetails.Text>
76
+ {item.details.recruiter.title}
77
+ </RecruiterDetails.Text>
78
+ )}
79
+ </RecruiterDetails>
80
+ )} */}
81
+ <ApplyButtonGroup
82
+ useDetailsPostMessage={useDetailsPostMessage}
83
+ navigateToDetails={navigateToDetails}
84
+ navigateToEasyApply={navigateToEasyApply}
85
+ Link={Link}
86
+ linkFormat={linkFormat}
87
+ easyApplyUrl={easyApplyUrl}
88
+ easyApplyText={easyApplyText}
89
+ includeDialog={useApplyDialog}
90
+ internalApplyLink={internalApplyLink}
91
+ companyName={companyName}
92
+ item={item}
93
+ trackEvent={trackEvent}
94
+ eventTypes={eventTypes}
95
+ detailsUrl={item.useClientJobUrl ? item?.detailsUrl : `${jobsDomain}${item.id}`}
96
+ className={`
97
+ 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
98
+ lg:hc-flex-col lg:hc-w-auto
99
+ `}
100
+ />
101
+ </div>
102
+ <div className="hc-w-full">
103
+ <CommutePill travelTime={travelTime} className="hc-ml-0" />
104
+ </div>
105
+ </div>
106
+ );
107
+ };
108
+
109
+ export default ListingDetails;
110
+
@@ -1,130 +1,130 @@
1
- import React from 'react';
2
-
3
- import Grid from '~/components/modules/grid';
4
- import Icon from '~/components/modules/icon';
5
- import PillWrapper from '~/components/modules/buttons/pill-wrapper';
6
-
7
- import { capitalize } from '~/util/stringUtils';
8
-
9
- const FieldMapper = ({
10
- item,
11
- fieldsShown,
12
- specialFeatures,
13
- handleFavouriteClick,
14
- isFavorite,
15
- includeFavorite = true
16
- }) => {
17
- const orderedFields = fieldsShown.filter(field => field in item.fields);
18
-
19
- const specialFeaturePills = field => {
20
- return field === 'position' && specialFeatures &&
21
- Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
22
- return item.fields[featureKey] == 1 && (
23
- <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
24
- );
25
- });
26
- };
27
-
28
- return (
29
- <>
30
- {orderedFields.map((field, index) => {
31
- let value = item.fields[field];
32
- return (
33
- <Grid.Item
34
- key={field}
35
- className={`
36
- hc-hidden md:hc-block hc-px-2
37
- ${index === 0 ? "hc-pl-7" : ""}
38
- ${field.toLowerCase() === "position" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
39
- `}
40
- >
41
- <span className="hc-sr-only">{capitalize(field)}</span>
42
- {value}
43
- <br />
44
- {specialFeaturePills(field)}
45
- </Grid.Item>
46
- );
47
- })}
48
- <Grid.Item className="md:hc-hidden">
49
- {fieldsShown.includes("position") &&
50
- <>
51
- <div className="hc-flex hc-items-start">
52
- <div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"> {}
53
- <h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.position}</h3>
54
- {includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
55
- <Icon
56
- icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
57
- size="hc-size-3.5"
58
- iconClasses={isFavorite ? "hc-text-primary" : ""}
59
- className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer
60
- ${isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100"}
61
- `}
62
- onClick={e => handleFavouriteClick(e, item)}
63
- />
64
- </div>
65
- }
66
- </div>
67
- </div>
68
- {specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("position", true)} </div>}
69
- </>
70
- }
71
-
72
- <ul className="hc-space-y-2 hc-text-xs">
73
- {[
74
- {
75
- field: "categoryClass",
76
- name: "categoryClass",
77
- icon: "icon-park-solid:tree-list"
78
- },
79
- {
80
- field: "category",
81
- name: "Category",
82
- icon: "icon-park-solid:tree-list"
83
- },
84
- {
85
- field: "schedule",
86
- name: "Schedule",
87
- icon: "gravity-ui:clock-fill"
88
- },
89
- {
90
- field: "city",
91
- name: "Location",
92
- icon: "fluent:location-16-filled"
93
- },
94
- {
95
- field: "state",
96
- name: "Location",
97
- icon: "fluent:location-16-filled"
98
- },
99
- {
100
- field: "cityState",
101
- name: "Location",
102
- icon: "fluent:location-16-filled"
103
- },
104
- {
105
- field: "travelTime",
106
- name: "Commute",
107
- icon: "ri:pin-distance-fill"
108
- }
109
- ].map(listItem => (
110
- (fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&
111
- <li
112
- key={listItem.field}
113
- className="hc-flex hc-gap-2"
114
- >
115
- <Icon
116
- icon={listItem.icon}
117
- size="hc-size-3.5"
118
- className="hc-text-uiAccent/30"
119
- />
120
- <span className="hc-sr-only">{listItem.name}</span>
121
- {item.fields[listItem.field]}
122
- </li>
123
- ))}
124
- </ul>
125
- </Grid.Item>
126
- </>
127
- );
128
- };
129
-
130
- export default FieldMapper;
1
+ import React from 'react';
2
+
3
+ import Grid from '~/components/modules/grid';
4
+ import Icon from '~/components/modules/icon';
5
+ import PillWrapper from '~/components/modules/buttons/pill-wrapper';
6
+
7
+ import { capitalize } from '~/util/stringUtils';
8
+
9
+ const FieldMapper = ({
10
+ item,
11
+ fieldsShown,
12
+ specialFeatures,
13
+ handleFavouriteClick,
14
+ isFavorite,
15
+ includeFavorite = true
16
+ }) => {
17
+ const orderedFields = fieldsShown.filter(field => field in item.fields);
18
+
19
+ const specialFeaturePills = field => {
20
+ return field === 'position' && specialFeatures &&
21
+ Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
22
+ return item.fields[featureKey] == 1 && (
23
+ <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
24
+ );
25
+ });
26
+ };
27
+
28
+ return (
29
+ <>
30
+ {orderedFields.map((field, index) => {
31
+ let value = item.fields[field];
32
+ return (
33
+ <Grid.Item
34
+ key={field}
35
+ className={`
36
+ hc-hidden md:hc-block hc-px-2
37
+ ${index === 0 ? "hc-pl-7" : ""}
38
+ ${field.toLowerCase() === "position" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
39
+ `}
40
+ >
41
+ <span className="hc-sr-only">{capitalize(field)}</span>
42
+ {value}
43
+ <br />
44
+ {specialFeaturePills(field)}
45
+ </Grid.Item>
46
+ );
47
+ })}
48
+ <Grid.Item className="md:hc-hidden">
49
+ {fieldsShown.includes("position") &&
50
+ <>
51
+ <div className="hc-flex hc-items-start">
52
+ <div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"> {}
53
+ <h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.position}</h3>
54
+ {includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
55
+ <Icon
56
+ icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
57
+ size="hc-size-3.5"
58
+ iconClasses={isFavorite ? "hc-text-primary" : ""}
59
+ className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer
60
+ ${isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100"}
61
+ `}
62
+ onClick={e => handleFavouriteClick(e, item)}
63
+ />
64
+ </div>
65
+ }
66
+ </div>
67
+ </div>
68
+ {specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("position", true)} </div>}
69
+ </>
70
+ }
71
+
72
+ <ul className="hc-space-y-2 hc-text-xs">
73
+ {[
74
+ {
75
+ field: "categoryClass",
76
+ name: "categoryClass",
77
+ icon: "icon-park-solid:tree-list"
78
+ },
79
+ {
80
+ field: "category",
81
+ name: "Category",
82
+ icon: "icon-park-solid:tree-list"
83
+ },
84
+ {
85
+ field: "schedule",
86
+ name: "Schedule",
87
+ icon: "gravity-ui:clock-fill"
88
+ },
89
+ {
90
+ field: "city",
91
+ name: "Location",
92
+ icon: "fluent:location-16-filled"
93
+ },
94
+ {
95
+ field: "state",
96
+ name: "Location",
97
+ icon: "fluent:location-16-filled"
98
+ },
99
+ {
100
+ field: "cityState",
101
+ name: "Location",
102
+ icon: "fluent:location-16-filled"
103
+ },
104
+ {
105
+ field: "travelTime",
106
+ name: "Commute",
107
+ icon: "ri:pin-distance-fill"
108
+ }
109
+ ].map(listItem => (
110
+ (fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&
111
+ <li
112
+ key={listItem.field}
113
+ className="hc-flex hc-gap-2"
114
+ >
115
+ <Icon
116
+ icon={listItem.icon}
117
+ size="hc-size-3.5"
118
+ className="hc-text-uiAccent/30"
119
+ />
120
+ <span className="hc-sr-only">{listItem.name}</span>
121
+ {item.fields[listItem.field]}
122
+ </li>
123
+ ))}
124
+ </ul>
125
+ </Grid.Item>
126
+ </>
127
+ );
128
+ };
129
+
130
+ export default FieldMapper;
@@ -1,92 +1,92 @@
1
- import React, { useState, useEffect } from 'react';
2
-
3
- import Button from '~/components/modules/buttons/default';
4
-
5
- const SORT_STATE = {
6
- notSorted: "not-sorted",
7
- sortedAsc: "sorted-asc",
8
- sortedDesc: "sorted-desc"
9
- };
10
-
11
- const HeaderItem = ({
12
- className,
13
- children,
14
- field,
15
- setSortSetting,
16
- sortSetting,
17
- isSortable,
18
- ...rest
19
- }) => {
20
- const [isSorted, setIsSorted] = useState(SORT_STATE.notSorted);
21
-
22
- const handleChange = field => {
23
- if (isSortable === false)
24
- return;
25
- let setting = {
26
- field: field,
27
- type: isSorted === SORT_STATE.sortedAsc ? "desc" : "asc"
28
- };
29
- setSortSetting(setting);
30
- isSorted === SORT_STATE.notSorted
31
- ? setIsSorted(SORT_STATE.sortedAsc)
32
- : isSorted === SORT_STATE.sortedAsc
33
- ? setIsSorted(SORT_STATE.sortedDesc)
34
- : setIsSorted(SORT_STATE.sortedAsc);
35
- };
36
-
37
- useEffect(() => {
38
- if (sortSetting?.field != null && sortSetting.field != field) {
39
- setIsSorted(SORT_STATE.notSorted);
40
- } else if (
41
- sortSetting?.field != null &&
42
- isSorted == SORT_STATE.notSorted &&
43
- sortSetting.field == field
44
- ) {
45
- setIsSorted(
46
- sortSetting.type == "asc"
47
- ? SORT_STATE.sortedAsc
48
- : SORT_STATE.sortedDesc
49
- );
50
- }
51
- }, [sortSetting, isSorted, field]);
52
-
53
- return (
54
- <Button.Btn
55
- onClick={() => handleChange(field)}
56
- variant="none"
57
- size="none"
58
- className={`
59
- hc-p-2 hc-rounded-none hc-text-left hc-normal-case hover:hc-bg-uiAccent/5 focus:hc-bg-uiAccent/5
60
- ${field.toLowerCase() === "position" ? "hc-pl-7 hc-col-span-4" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
61
- ${className ?? ""}
62
- `}
63
- {...rest}
64
- >
65
- <Button.Body>
66
- <span className="hc-font-semibold">{children}</span>
67
- {isSortable && (
68
- <div className="hc-flex hc-flex-col hc-pr-2">
69
- <Button.Icon
70
- icon="bi:caret-up-fill"
71
- size="hc-size-2.5"
72
- className={`
73
- hc-transition-opacity
74
- ${isSorted === "sorted-asc" ? "hc-opacity-100 hc-text-primary" : "hc-opacity-30"}
75
- `}
76
- />
77
- <Button.Icon
78
- icon="bi:caret-down-fill"
79
- size="hc-size-2.5"
80
- className={`
81
- transition-opacity
82
- ${isSorted === "sorted-desc" ? "hc-opacity-100" : "hc-opacity-30"}
83
- `}
84
- />
85
- </div>
86
- )}
87
- </Button.Body>
88
- </Button.Btn>
89
- );
90
- };
91
-
92
- export default HeaderItem;
1
+ import React, { useState, useEffect } from 'react';
2
+
3
+ import Button from '~/components/modules/buttons/default';
4
+
5
+ const SORT_STATE = {
6
+ notSorted: "not-sorted",
7
+ sortedAsc: "sorted-asc",
8
+ sortedDesc: "sorted-desc"
9
+ };
10
+
11
+ const HeaderItem = ({
12
+ className,
13
+ children,
14
+ field,
15
+ setSortSetting,
16
+ sortSetting,
17
+ isSortable,
18
+ ...rest
19
+ }) => {
20
+ const [isSorted, setIsSorted] = useState(SORT_STATE.notSorted);
21
+
22
+ const handleChange = field => {
23
+ if (isSortable === false)
24
+ return;
25
+ let setting = {
26
+ field: field,
27
+ type: isSorted === SORT_STATE.sortedAsc ? "desc" : "asc"
28
+ };
29
+ setSortSetting(setting);
30
+ isSorted === SORT_STATE.notSorted
31
+ ? setIsSorted(SORT_STATE.sortedAsc)
32
+ : isSorted === SORT_STATE.sortedAsc
33
+ ? setIsSorted(SORT_STATE.sortedDesc)
34
+ : setIsSorted(SORT_STATE.sortedAsc);
35
+ };
36
+
37
+ useEffect(() => {
38
+ if (sortSetting?.field != null && sortSetting.field != field) {
39
+ setIsSorted(SORT_STATE.notSorted);
40
+ } else if (
41
+ sortSetting?.field != null &&
42
+ isSorted == SORT_STATE.notSorted &&
43
+ sortSetting.field == field
44
+ ) {
45
+ setIsSorted(
46
+ sortSetting.type == "asc"
47
+ ? SORT_STATE.sortedAsc
48
+ : SORT_STATE.sortedDesc
49
+ );
50
+ }
51
+ }, [sortSetting, isSorted, field]);
52
+
53
+ return (
54
+ <Button.Btn
55
+ onClick={() => handleChange(field)}
56
+ variant="none"
57
+ size="none"
58
+ className={`
59
+ hc-p-2 hc-rounded-none hc-text-left hc-normal-case hover:hc-bg-uiAccent/5 focus:hc-bg-uiAccent/5
60
+ ${field.toLowerCase() === "position" ? "hc-pl-7 hc-col-span-4" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
61
+ ${className ?? ""}
62
+ `}
63
+ {...rest}
64
+ >
65
+ <Button.Body>
66
+ <span className="hc-font-semibold">{children}</span>
67
+ {isSortable && (
68
+ <div className="hc-flex hc-flex-col hc-pr-2">
69
+ <Button.Icon
70
+ icon="bi:caret-up-fill"
71
+ size="hc-size-2.5"
72
+ className={`
73
+ hc-transition-opacity
74
+ ${isSorted === "sorted-asc" ? "hc-opacity-100 hc-text-primary" : "hc-opacity-30"}
75
+ `}
76
+ />
77
+ <Button.Icon
78
+ icon="bi:caret-down-fill"
79
+ size="hc-size-2.5"
80
+ className={`
81
+ transition-opacity
82
+ ${isSorted === "sorted-desc" ? "hc-opacity-100" : "hc-opacity-30"}
83
+ `}
84
+ />
85
+ </div>
86
+ )}
87
+ </Button.Body>
88
+ </Button.Btn>
89
+ );
90
+ };
91
+
92
+ export default HeaderItem;