@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.
- package/dist/components/HireControlMap.js +11 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/commute-container.js +1 -1
- package/dist/components/containers/filter/commute-container.js.map +1 -1
- package/dist/components/containers/filter/filter-container.js.map +1 -1
- package/dist/components/containers/filter/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
- package/dist/components/containers/filter/search-container.js.map +1 -1
- package/dist/components/containers/jobListing/listing-details-container.js +5 -1
- package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +1 -1
- package/dist/components/containers/maps/map-list-container.js.map +1 -1
- package/dist/components/containers/maps/map-marker-container.js +1 -1
- package/dist/components/containers/maps/map-marker-container.js.map +1 -1
- package/dist/components/modules/accordions/default.js +2 -2
- 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 +48 -54
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/default.js +2 -2
- package/dist/components/modules/cards/default.js +2 -2
- package/dist/components/modules/dialogs/apply-dialog.js +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +2 -2
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js +2 -2
- package/dist/components/modules/grid.js +1 -1
- package/dist/components/modules/icon.js +1 -1
- package/dist/components/modules/jobListing/listing-details.js +8 -7
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/list/field-mapper.js.map +1 -1
- package/dist/components/modules/list/header-item.js.map +1 -1
- package/dist/components/modules/list/header.js +1 -1
- package/dist/components/modules/list/item-expand-card/index.js +1 -1
- package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js +38 -38
- package/dist/components/modules/list/item-expand-card/recruiter-details.js +40 -40
- package/dist/components/modules/list/item-expand-card/recruiter-headshot.js +20 -20
- package/dist/components/modules/list/item-list.js +3 -3
- package/dist/components/modules/list/item-list.js.map +1 -1
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +1 -1
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js +1 -1
- package/dist/components/modules/maps/place-marker.js +1 -1
- package/dist/components/modules/maps/tabs.js +1 -1
- package/dist/constants/eventTypes.js +1 -0
- package/dist/constants/eventTypes.js.map +1 -1
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +3 -1
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/contexts/themeContext.js.map +1 -1
- package/dist/services/configService.js.map +1 -1
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js.map +1 -1
- package/dist/services/recruiterService.js.map +1 -1
- package/dist/types/components/modules/buttons/button-group-apply.d.ts +4 -4
- package/dist/types/components/modules/jobListing/listing-details.d.ts +3 -1
- package/dist/types/constants/eventTypes.d.ts +1 -0
- package/dist/types/contexts/mapListContext.d.ts +4 -0
- package/dist/util/filterUtil.js +3 -3
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/dist/util/mapUtil.js.map +1 -1
- package/package.json +90 -90
- package/src/.editorconfig +12 -12
- package/src/bundleIndex.js +14 -14
- package/src/components/HireControlMap.js +148 -142
- package/src/components/containers/accordions/filter-item-container.js +83 -83
- package/src/components/containers/filter/commute-container.js +89 -89
- package/src/components/containers/filter/filter-container.js +76 -76
- package/src/components/containers/filter/filter-item-container.js +117 -117
- package/src/components/containers/filter/location-container.js +45 -45
- package/src/components/containers/filter/points-of-interest-container.js +33 -33
- package/src/components/containers/filter/points-of-interest-radio-item-container.js +35 -35
- package/src/components/containers/filter/search-container.js +61 -61
- package/src/components/containers/jobListing/listing-details-container.js +3 -1
- package/src/components/containers/list/item-list-container.tsx +81 -81
- package/src/components/containers/maps/info-window-content-container.js +53 -53
- package/src/components/containers/maps/map-list-container.js +50 -50
- package/src/components/containers/maps/map-marker-container.js +78 -78
- package/src/components/modules/accordions/filterItem.js +27 -27
- package/src/components/modules/accordions/filters.js +32 -32
- package/src/components/modules/buttons/button-group-apply.js +115 -135
- package/src/components/modules/dialogs/apply-dialog.js +48 -48
- package/src/components/modules/filter/commute.js +108 -108
- package/src/components/modules/filter/index.js +55 -55
- package/src/components/modules/filter/location.js +51 -51
- package/src/components/modules/filter/radio-item.js +42 -42
- package/src/components/modules/filter/search.js +79 -79
- package/src/components/modules/jobListing/listing-details.js +110 -108
- package/src/components/modules/list/field-mapper.js +130 -130
- package/src/components/modules/list/header-item.js +92 -92
- package/src/components/modules/list/item-expand-card/index.js +22 -22
- package/src/components/modules/list/item-list.tsx +117 -117
- package/src/components/modules/list/list-item/list-item.js +130 -130
- package/src/components/modules/maps/info-window-content.js +64 -64
- package/src/components/modules/maps/map-list.js +38 -38
- package/src/components/modules/maps/map-marker.js +29 -29
- package/src/constants/eventTypes.js +15 -14
- package/src/contexts/mapContext.tsx +129 -129
- package/src/contexts/mapListContext.tsx +326 -318
- package/src/contexts/placesContext.js +102 -102
- package/src/contexts/themeContext.js +40 -40
- package/src/services/configService.ts +16 -16
- package/src/services/listingEntityService.ts +16 -16
- package/src/services/listingService.ts +40 -40
- package/src/services/recruiterService.ts +18 -18
- package/src/styles/bundle.css +268 -268
- package/src/styles/index.css +33 -33
- package/src/types/Address.ts +7 -7
- package/src/types/ContentSection.ts +9 -9
- package/src/types/GetListingParams.ts +8 -8
- package/src/types/LatLng.ts +4 -4
- package/src/types/ListingEntity.ts +11 -11
- package/src/types/ListingFields.ts +25 -25
- package/src/types/Listings.ts +32 -32
- package/src/types/Recruiter.ts +9 -9
- package/src/types/SimilarListing.ts +24 -24
- package/src/types/config/Colors.ts +8 -8
- package/src/types/config/MapConfig.ts +31 -31
- package/src/types/config/PointsOfInterestConfig.ts +13 -13
- package/src/types/config/SearchConfig.ts +4 -4
- package/src/util/filterUtil.js +2 -1
- package/src/util/mapIconUtil.js +180 -180
- package/src/util/mapUtil.js +92 -92
- 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
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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;
|