@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.
- package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/apis/hcApi.js +1 -1
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/clientToken.js.map +1 -1
- package/dist/components/HireControlMap.js +15 -5
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +11 -1
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/default.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js +2 -1
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js +0 -3
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +36 -15
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/commute-pill.js.map +1 -1
- package/dist/components/modules/buttons/default.js.map +1 -1
- package/dist/components/modules/buttons/items-pill.js.map +1 -1
- package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
- package/dist/components/modules/buttons/show-all-button.js.map +1 -1
- package/dist/components/modules/cards/default.js.map +1 -1
- package/dist/components/modules/cards/filter.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +22 -6
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js +7 -0
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/item.js +16 -1
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +1 -1
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/points-of-interest.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +7 -0
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js.map +1 -1
- package/dist/components/modules/grid.js.map +1 -1
- package/dist/components/modules/icon.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +6 -0
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/maps/info-window-card.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js +20 -0
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
- package/dist/components/modules/maps/list/header-item.js.map +1 -1
- package/dist/components/modules/maps/list/header.js.map +1 -1
- package/dist/components/modules/maps/list/index.js +21 -12
- package/dist/components/modules/maps/list/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
- package/dist/components/modules/maps/list/list-item/index.js +12 -2
- package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +10 -0
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js.map +1 -1
- package/dist/components/modules/maps/place-marker.js.map +1 -1
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/constants/eventTypes.js +16 -0
- package/dist/constants/eventTypes.js.map +1 -0
- package/dist/constants/placeTypes.js.map +1 -1
- package/dist/contexts/mapContext.js +9 -27
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +57 -38
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/contexts/trackEventContext.js +20 -0
- package/dist/contexts/trackEventContext.js.map +1 -0
- package/dist/hooks/useList.js +1 -13
- package/dist/hooks/useList.js.map +1 -1
- package/dist/services/apis/hcApi.js +1 -1
- package/dist/services/apis/hcApi.js.map +1 -1
- package/dist/services/clientToken.js.map +1 -1
- package/dist/services/configService.js.map +1 -1
- package/dist/services/googlePlacesNearbyService.js.map +1 -1
- package/dist/services/listingAggregatorService.js +43 -16
- package/dist/services/listingAggregatorService.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/util/filterUtil.js.map +1 -1
- package/dist/util/loading.js.map +1 -1
- package/dist/util/localStorageUtil.js.map +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/dist/util/mapUtil.js.map +1 -1
- package/dist/util/sortUtil.js.map +1 -1
- package/dist/util/stringUtils.js.map +1 -1
- package/jsconfig.json +7 -7
- package/package.json +60 -60
- package/postcss.config.js +13 -13
- package/preset.default.js +15 -15
- package/rollup.config.mjs +88 -87
- package/src/apis/hcApi.js +93 -93
- package/src/clientToken.js +9 -9
- package/src/components/HireControlMap.js +129 -124
- package/src/components/modules/accordions/MapAccordionItem.js +74 -72
- package/src/components/modules/accordions/default.js +171 -171
- package/src/components/modules/accordions/filterItem.js +55 -53
- package/src/components/modules/accordions/filters.js +47 -47
- package/src/components/modules/buttons/button-group-apply.js +123 -116
- package/src/components/modules/buttons/commute-pill.js +22 -22
- package/src/components/modules/buttons/default.js +194 -194
- package/src/components/modules/buttons/items-pill.js +35 -35
- package/src/components/modules/buttons/pill-wrapper.js +27 -27
- package/src/components/modules/buttons/show-all-button.js +20 -20
- package/src/components/modules/cards/default.js +167 -167
- package/src/components/modules/cards/filter.js +56 -56
- package/src/components/modules/dialogs/apply-dialog.js +48 -48
- package/src/components/modules/filter/commute.js +154 -149
- package/src/components/modules/filter/index.js +89 -87
- package/src/components/modules/filter/item.js +87 -76
- package/src/components/modules/filter/location.js +71 -71
- package/src/components/modules/filter/points-of-interest.js +44 -44
- package/src/components/modules/filter/radio-item.js +57 -53
- package/src/components/modules/filter/search.js +92 -92
- package/src/components/modules/filter/sort.js +83 -83
- package/src/components/modules/grid.js +54 -54
- package/src/components/modules/icon.js +33 -33
- package/src/components/modules/jobListing/listing-details.js +99 -95
- package/src/components/modules/maps/info-window-card.js +17 -17
- package/src/components/modules/maps/info-window-content.js +81 -74
- package/src/components/modules/maps/list/field-mapper.js +112 -112
- package/src/components/modules/maps/list/header-item.js +91 -91
- package/src/components/modules/maps/list/header.js +47 -47
- package/src/components/modules/maps/list/index.js +112 -107
- package/src/components/modules/maps/list/item-expand-card/index.js +22 -22
- package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +50 -50
- package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +68 -68
- package/src/components/modules/maps/list/item-expand-card/recruiter-headshot.js +22 -22
- package/src/components/modules/maps/list/list-item/index.js +135 -133
- package/src/components/modules/maps/map-list.js +74 -74
- package/src/components/modules/maps/map-marker.js +88 -86
- package/src/components/modules/maps/map.js +230 -230
- package/src/components/modules/maps/place-marker.js +41 -41
- package/src/components/modules/maps/tabs.js +81 -81
- package/src/constants/eventTypes.js +13 -0
- package/src/constants/placeTypes.js +8 -8
- package/src/contexts/mapContext.js +101 -115
- package/src/contexts/mapListContext.js +242 -222
- package/src/contexts/placesContext.js +102 -102
- package/src/contexts/trackEventContext.js +14 -0
- package/src/hooks/useList.js +89 -100
- package/src/index.js +3 -3
- package/src/services/configService.js +16 -16
- package/src/services/googlePlacesNearbyService.js +33 -33
- package/src/services/listingAggregatorService.js +50 -45
- package/src/services/listingEntityService.js +15 -15
- package/src/services/listingService.js +26 -26
- package/src/services/recruiterService.js +17 -17
- package/src/styles/index.css +23 -23
- package/src/util/arrayUtil.js +3 -3
- package/src/util/fieldMapper.js +22 -22
- package/src/util/filterUtil.js +195 -195
- package/src/util/loading.js +17 -17
- package/src/util/localStorageUtil.js +26 -26
- package/src/util/mapIconUtil.js +180 -180
- package/src/util/mapUtil.js +91 -91
- package/src/util/sortUtil.js +32 -32
- package/src/util/stringUtils.js +6 -6
- package/src/util/urlFilterUtil.js +90 -90
- package/tailwind.config.js +126 -126
- package/.editorconfig +0 -12
- package/.eslintrc +0 -105
- package/.prettierignore +0 -3
|
@@ -1,91 +1,91 @@
|
|
|
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
|
-
className={`
|
|
58
|
-
hc-p-2 hc-rounded-none hc-text-left hc-normal-case hover:hc-bg-uiAccent/5 focus:hc-bg-uiAccent/5
|
|
59
|
-
${field.toLowerCase() === "position" ? "hc-col-span-2" : "hc-col-span-1"}
|
|
60
|
-
${className ?? ""}
|
|
61
|
-
`}
|
|
62
|
-
{...rest}
|
|
63
|
-
>
|
|
64
|
-
<Button.Body>
|
|
65
|
-
<span className="hc-font-semibold">{children}</span>
|
|
66
|
-
{isSortable && (
|
|
67
|
-
<div className="hc-flex hc-flex-col hc-pr-2">
|
|
68
|
-
<Button.Icon
|
|
69
|
-
icon="bi:caret-up-fill"
|
|
70
|
-
size="hc-size-2.5"
|
|
71
|
-
className={`
|
|
72
|
-
hc-transition-opacity
|
|
73
|
-
${isSorted === "sorted-asc" ? "hc-opacity-100 hc-text-primary" : "hc-opacity-30"}
|
|
74
|
-
`}
|
|
75
|
-
/>
|
|
76
|
-
<Button.Icon
|
|
77
|
-
icon="bi:caret-down-fill"
|
|
78
|
-
size="hc-size-2.5"
|
|
79
|
-
className={`
|
|
80
|
-
transition-opacity
|
|
81
|
-
${isSorted === "sorted-desc" ? "hc-opacity-100" : "hc-opacity-30"}
|
|
82
|
-
`}
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
)}
|
|
86
|
-
</Button.Body>
|
|
87
|
-
</Button.Btn>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
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
|
+
className={`
|
|
58
|
+
hc-p-2 hc-rounded-none hc-text-left hc-normal-case hover:hc-bg-uiAccent/5 focus:hc-bg-uiAccent/5
|
|
59
|
+
${field.toLowerCase() === "position" ? "hc-col-span-2" : "hc-col-span-1"}
|
|
60
|
+
${className ?? ""}
|
|
61
|
+
`}
|
|
62
|
+
{...rest}
|
|
63
|
+
>
|
|
64
|
+
<Button.Body>
|
|
65
|
+
<span className="hc-font-semibold">{children}</span>
|
|
66
|
+
{isSortable && (
|
|
67
|
+
<div className="hc-flex hc-flex-col hc-pr-2">
|
|
68
|
+
<Button.Icon
|
|
69
|
+
icon="bi:caret-up-fill"
|
|
70
|
+
size="hc-size-2.5"
|
|
71
|
+
className={`
|
|
72
|
+
hc-transition-opacity
|
|
73
|
+
${isSorted === "sorted-asc" ? "hc-opacity-100 hc-text-primary" : "hc-opacity-30"}
|
|
74
|
+
`}
|
|
75
|
+
/>
|
|
76
|
+
<Button.Icon
|
|
77
|
+
icon="bi:caret-down-fill"
|
|
78
|
+
size="hc-size-2.5"
|
|
79
|
+
className={`
|
|
80
|
+
transition-opacity
|
|
81
|
+
${isSorted === "sorted-desc" ? "hc-opacity-100" : "hc-opacity-30"}
|
|
82
|
+
`}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
</Button.Body>
|
|
87
|
+
</Button.Btn>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default HeaderItem;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
import Grid from '~/components/modules/grid';
|
|
5
|
-
import HeaderItem from '~/components/modules/maps/list/header-item';
|
|
6
|
-
|
|
7
|
-
const ListHeader = ({
|
|
8
|
-
className,
|
|
9
|
-
fieldsShown,
|
|
10
|
-
fieldNames,
|
|
11
|
-
fieldIsSortable = true,
|
|
12
|
-
setSortSetting,
|
|
13
|
-
sortSetting
|
|
14
|
-
}) => {
|
|
15
|
-
return (
|
|
16
|
-
<Grid
|
|
17
|
-
columns="hc-grid-flow-col hc-auto-cols-fr"
|
|
18
|
-
gap="hc-gap-0"
|
|
19
|
-
isAnimated={false}
|
|
20
|
-
className={twMerge`
|
|
21
|
-
hc-hidden md:hc-grid hc-bg-uiAccent/10 hc-border-b hc-border-uiAccent/10 hc-sticky hc-top-0 hc-z-10
|
|
22
|
-
${className ?? ""}
|
|
23
|
-
`}
|
|
24
|
-
>
|
|
25
|
-
{fieldsShown.map(field => (
|
|
26
|
-
<HeaderItem
|
|
27
|
-
key={field}
|
|
28
|
-
isSortable={fieldIsSortable}
|
|
29
|
-
sortSetting={sortSetting}
|
|
30
|
-
field={field}
|
|
31
|
-
setSortSetting={setSortSetting}
|
|
32
|
-
>
|
|
33
|
-
{fieldNames[field]}
|
|
34
|
-
</HeaderItem>
|
|
35
|
-
))}
|
|
36
|
-
<HeaderItem key={"favorite"}
|
|
37
|
-
isSortable={false}
|
|
38
|
-
field={"favorite"}
|
|
39
|
-
>
|
|
40
|
-
Favorite
|
|
41
|
-
</HeaderItem>
|
|
42
|
-
|
|
43
|
-
</Grid>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default ListHeader;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
import Grid from '~/components/modules/grid';
|
|
5
|
+
import HeaderItem from '~/components/modules/maps/list/header-item';
|
|
6
|
+
|
|
7
|
+
const ListHeader = ({
|
|
8
|
+
className,
|
|
9
|
+
fieldsShown,
|
|
10
|
+
fieldNames,
|
|
11
|
+
fieldIsSortable = true,
|
|
12
|
+
setSortSetting,
|
|
13
|
+
sortSetting
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<Grid
|
|
17
|
+
columns="hc-grid-flow-col hc-auto-cols-fr"
|
|
18
|
+
gap="hc-gap-0"
|
|
19
|
+
isAnimated={false}
|
|
20
|
+
className={twMerge`
|
|
21
|
+
hc-hidden md:hc-grid hc-bg-uiAccent/10 hc-border-b hc-border-uiAccent/10 hc-sticky hc-top-0 hc-z-10
|
|
22
|
+
${className ?? ""}
|
|
23
|
+
`}
|
|
24
|
+
>
|
|
25
|
+
{fieldsShown.map(field => (
|
|
26
|
+
<HeaderItem
|
|
27
|
+
key={field}
|
|
28
|
+
isSortable={fieldIsSortable}
|
|
29
|
+
sortSetting={sortSetting}
|
|
30
|
+
field={field}
|
|
31
|
+
setSortSetting={setSortSetting}
|
|
32
|
+
>
|
|
33
|
+
{fieldNames[field]}
|
|
34
|
+
</HeaderItem>
|
|
35
|
+
))}
|
|
36
|
+
<HeaderItem key={"favorite"}
|
|
37
|
+
isSortable={false}
|
|
38
|
+
field={"favorite"}
|
|
39
|
+
>
|
|
40
|
+
Favorite
|
|
41
|
+
</HeaderItem>
|
|
42
|
+
|
|
43
|
+
</Grid>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default ListHeader;
|
|
@@ -1,107 +1,112 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Accordion from '~/components/modules/accordions/default';
|
|
4
|
-
import Header from '~/components/modules/maps/list/header';
|
|
5
|
-
import MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';
|
|
6
|
-
import Sort from '~/components/modules/filter/sort';
|
|
7
|
-
import ListingDetails from '~/components/modules/jobListing/listing-details';
|
|
8
|
-
|
|
9
|
-
import useListLogic from '~/hooks/useList';
|
|
10
|
-
|
|
11
|
-
import Loading from "~/util/loading";
|
|
12
|
-
|
|
13
|
-
import { useMap } from '~/contexts/mapContext';
|
|
14
|
-
import { useMapList } from '~/contexts/mapListContext';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const {
|
|
33
|
-
const
|
|
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
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Accordion from '~/components/modules/accordions/default';
|
|
4
|
+
import Header from '~/components/modules/maps/list/header';
|
|
5
|
+
import MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';
|
|
6
|
+
import Sort from '~/components/modules/filter/sort';
|
|
7
|
+
import ListingDetails from '~/components/modules/jobListing/listing-details';
|
|
8
|
+
|
|
9
|
+
import useListLogic from '~/hooks/useList';
|
|
10
|
+
|
|
11
|
+
import Loading from "~/util/loading";
|
|
12
|
+
|
|
13
|
+
import { useMap } from '~/contexts/mapContext';
|
|
14
|
+
import { useMapList } from '~/contexts/mapListContext';
|
|
15
|
+
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
16
|
+
|
|
17
|
+
import { dynamicSort } from '~/util/sortUtil';
|
|
18
|
+
|
|
19
|
+
const ItemsList = ({
|
|
20
|
+
fieldNames,
|
|
21
|
+
showMap,
|
|
22
|
+
fieldsShown,
|
|
23
|
+
specialFeatures
|
|
24
|
+
}) => {
|
|
25
|
+
const { mapItems, filteredListings, loading, commuteLocation, sortSetting, setSortSetting } = useMapList();
|
|
26
|
+
const {
|
|
27
|
+
itemLimit,
|
|
28
|
+
loader,
|
|
29
|
+
scrollContainerRef,
|
|
30
|
+
itemRefs
|
|
31
|
+
} = useListLogic(filteredListings);
|
|
32
|
+
const { selectedListItem } = useMap();
|
|
33
|
+
const { trackEvent, eventTypes } = useTrackEvent();
|
|
34
|
+
const itemExpandedContent = (item, recruiters) =>
|
|
35
|
+
item ? <ListingDetails item={item} recruiters={recruiters} /> : null;
|
|
36
|
+
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
|
|
37
|
+
fieldsShown.push('travelTime');
|
|
38
|
+
fieldNames['travelTime'] = 'Commute';
|
|
39
|
+
} else if (fieldsShown.includes('travelTime') && !commuteLocation) {
|
|
40
|
+
fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const setTrackedSortSetting = sortSetting => {
|
|
44
|
+
trackEvent(eventTypes.LIST_SORTED, sortSetting);
|
|
45
|
+
setSortSetting(sortSetting);
|
|
46
|
+
};
|
|
47
|
+
return (
|
|
48
|
+
<div className="hc-relative hc-bg-white md:hc-px-4 hc-flex hc-flex-col">
|
|
49
|
+
<div className="hc-flex hc-flex-wrap hc-items-center hc-justify-between hc-gap-4 md:hc-mb-2 hc-p-3 md:hc-p-0 hc-bg-uiAccent/10 md:hc-bg-transparent hc-border-b md:hc-border-none hc-border-uiAccent/20">
|
|
50
|
+
<h2 className="hc-text-gray-500 hc-font-semibold hc-text-xs md:hc-text-sm">
|
|
51
|
+
{loading &&
|
|
52
|
+
<span>Loading...</span>
|
|
53
|
+
}
|
|
54
|
+
{!loading &&
|
|
55
|
+
<span>{filteredListings.length} results</span>
|
|
56
|
+
}
|
|
57
|
+
</h2>
|
|
58
|
+
<div className="hc-block md:hc-hidden">
|
|
59
|
+
<Sort
|
|
60
|
+
fields={fieldsShown}
|
|
61
|
+
setSortSetting={setTrackedSortSetting}
|
|
62
|
+
fieldNames={fieldNames}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div>
|
|
67
|
+
<Header
|
|
68
|
+
setSortSetting={setTrackedSortSetting}
|
|
69
|
+
sortSetting={sortSetting}
|
|
70
|
+
fieldsShown={fieldsShown}
|
|
71
|
+
fieldNames={fieldNames}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
ref={scrollContainerRef}
|
|
76
|
+
className={`
|
|
77
|
+
hc-flex-grow hc-overflow-y-auto
|
|
78
|
+
${showMap ? "md:hc-max-h-45vh hc-max-h-[100vh]" : "md:hc-max-h-95vh hc-max-h-[95vh]"}
|
|
79
|
+
`}
|
|
80
|
+
>
|
|
81
|
+
{loading ? (
|
|
82
|
+
<div className="hc-flex hc-justify-center hc-items-center hc-pt-20">
|
|
83
|
+
<Loading />
|
|
84
|
+
</div>
|
|
85
|
+
) : (
|
|
86
|
+
<Accordion className="hc-divide-y hc-divide-uiAccent/10 hc-z-[1000]" defaultValue={selectedListItem?.id}>
|
|
87
|
+
{(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type) : filteredListings).slice(0, itemLimit).map(item => {
|
|
88
|
+
return (<MapAccordionItem
|
|
89
|
+
key={item.id}
|
|
90
|
+
showMap={showMap}
|
|
91
|
+
item={item}
|
|
92
|
+
itemRefs={itemRefs}
|
|
93
|
+
fieldsShown={fieldsShown}
|
|
94
|
+
itemExpandedContent={itemExpandedContent}
|
|
95
|
+
specialFeatures={specialFeatures}
|
|
96
|
+
mapItems={mapItems}
|
|
97
|
+
isActive={selectedListItem?.id == item.id}
|
|
98
|
+
hasListItemSelected={selectedListItem != null}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
})}
|
|
102
|
+
</Accordion>
|
|
103
|
+
)}
|
|
104
|
+
<div ref={loader} style={{ height: "100px", textAlign: "center" }}>
|
|
105
|
+
{filteredListings.length >= itemLimit && <Loading />}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export default ItemsList;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
const CardItemExpand = ({
|
|
5
|
-
className,
|
|
6
|
-
content,
|
|
7
|
-
...props
|
|
8
|
-
}) => {
|
|
9
|
-
return (
|
|
10
|
-
<div
|
|
11
|
-
className={twMerge(
|
|
12
|
-
'hc-flex hc-flex-col lg:hc-flex-row hc-flex-wrap hc-items-stretch hc-gap-x-4 hc-w-full lg:hc-pt-2 hc-border-t hc-border-uiAccent/20',
|
|
13
|
-
className ?? ''
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
{content}
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default CardItemExpand;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
const CardItemExpand = ({
|
|
5
|
+
className,
|
|
6
|
+
content,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
className={twMerge(
|
|
12
|
+
'hc-flex hc-flex-col lg:hc-flex-row hc-flex-wrap hc-items-stretch hc-gap-x-4 hc-w-full lg:hc-pt-2 hc-border-t hc-border-uiAccent/20',
|
|
13
|
+
className ?? ''
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
{content}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default CardItemExpand;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Button from '~/components/modules/buttons/default';
|
|
4
|
-
|
|
5
|
-
const RecruiterContactNav = ({
|
|
6
|
-
children,
|
|
7
|
-
className
|
|
8
|
-
}) => {
|
|
9
|
-
return (
|
|
10
|
-
<nav
|
|
11
|
-
className={`
|
|
12
|
-
hc-inline-flex hc-items-center hc-justify-between hc-gap-2 hc-mt-2
|
|
13
|
-
${className ?? ''}
|
|
14
|
-
`}
|
|
15
|
-
>
|
|
16
|
-
{children}
|
|
17
|
-
</nav>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const NavButton = ({
|
|
22
|
-
className,
|
|
23
|
-
href,
|
|
24
|
-
target = '_self',
|
|
25
|
-
title,
|
|
26
|
-
icon,
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
29
|
-
return (
|
|
30
|
-
<Button.Anchor
|
|
31
|
-
href={href}
|
|
32
|
-
variant="icon"
|
|
33
|
-
size="sq"
|
|
34
|
-
target={target}
|
|
35
|
-
title={title}
|
|
36
|
-
className={className ?? ''}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
<span className="hc-sr-only">{title}</span>
|
|
40
|
-
<Button.Icon
|
|
41
|
-
icon={icon}
|
|
42
|
-
size="hc-size-8"
|
|
43
|
-
/>
|
|
44
|
-
</Button.Anchor>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
RecruiterContactNav.Button = NavButton;
|
|
49
|
-
|
|
50
|
-
export default RecruiterContactNav;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Button from '~/components/modules/buttons/default';
|
|
4
|
+
|
|
5
|
+
const RecruiterContactNav = ({
|
|
6
|
+
children,
|
|
7
|
+
className
|
|
8
|
+
}) => {
|
|
9
|
+
return (
|
|
10
|
+
<nav
|
|
11
|
+
className={`
|
|
12
|
+
hc-inline-flex hc-items-center hc-justify-between hc-gap-2 hc-mt-2
|
|
13
|
+
${className ?? ''}
|
|
14
|
+
`}
|
|
15
|
+
>
|
|
16
|
+
{children}
|
|
17
|
+
</nav>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const NavButton = ({
|
|
22
|
+
className,
|
|
23
|
+
href,
|
|
24
|
+
target = '_self',
|
|
25
|
+
title,
|
|
26
|
+
icon,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<Button.Anchor
|
|
31
|
+
href={href}
|
|
32
|
+
variant="icon"
|
|
33
|
+
size="sq"
|
|
34
|
+
target={target}
|
|
35
|
+
title={title}
|
|
36
|
+
className={className ?? ''}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
<span className="hc-sr-only">{title}</span>
|
|
40
|
+
<Button.Icon
|
|
41
|
+
icon={icon}
|
|
42
|
+
size="hc-size-8"
|
|
43
|
+
/>
|
|
44
|
+
</Button.Anchor>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
RecruiterContactNav.Button = NavButton;
|
|
49
|
+
|
|
50
|
+
export default RecruiterContactNav;
|