@abcagency/hc-ui-components 1.3.52 → 1.3.54
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 +10 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/apis/hcApi.js +1 -1
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/contexts/mapListContext.js +1 -1
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/util/filterUtil.js +53 -27
- package/dist/util/filterUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modules/buttons/button-group-apply.js +130 -130
- package/src/contexts/mapListContext.tsx +1 -1
- package/src/util/filterUtil.js +310 -280
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
import Button from '~/components/modules/buttons/default';
|
|
5
|
-
import ApplyDialog from '../dialogs/apply-dialog';
|
|
6
|
-
|
|
7
|
-
const ButtonGroupApply = ({
|
|
8
|
-
applyUrl,
|
|
9
|
-
useDetailsPostMessage,
|
|
10
|
-
navigateToDetails,
|
|
11
|
-
navigateToEasyApply,
|
|
12
|
-
Link,
|
|
13
|
-
linkFormat,
|
|
14
|
-
applyText = 'Apply Now',
|
|
15
|
-
detailsUrl,
|
|
16
|
-
detailsText = 'View Details',
|
|
17
|
-
className,
|
|
18
|
-
buttonSize = 'sm',
|
|
19
|
-
applyButtonVariant = 'primary',
|
|
20
|
-
detailsButtonVariant = 'outline',
|
|
21
|
-
includeDialog = false,
|
|
22
|
-
internalApplyLink,
|
|
23
|
-
itemId,
|
|
24
|
-
item,
|
|
25
|
-
companyName,
|
|
26
|
-
trackEvent,
|
|
27
|
-
eventTypes
|
|
28
|
-
}) => {
|
|
29
|
-
const href = linkFormat.replace('[slug]', item.slug ?? item.id);
|
|
30
|
-
|
|
31
|
-
const trackApply = () => {
|
|
32
|
-
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const trackViewDetails = () => {
|
|
36
|
-
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<nav
|
|
41
|
-
className={twMerge`
|
|
42
|
-
hc-flex hc-flex-row hc-justify-between hc-gap-2 hc-w-full
|
|
43
|
-
${className ?? ''}
|
|
44
|
-
`}
|
|
45
|
-
>
|
|
46
|
-
{Link &&
|
|
47
|
-
<Button.Link
|
|
48
|
-
Link={Link}
|
|
49
|
-
href={href}
|
|
50
|
-
variant={detailsButtonVariant}
|
|
51
|
-
size={buttonSize}
|
|
52
|
-
className={"map-details-button"}
|
|
53
|
-
onClick={trackViewDetails}
|
|
54
|
-
>
|
|
55
|
-
{detailsText}
|
|
56
|
-
</Button.Link>
|
|
57
|
-
}
|
|
58
|
-
{navigateToDetails &&
|
|
59
|
-
<Button.Anchor
|
|
60
|
-
href={href}
|
|
61
|
-
onClick={e => {
|
|
62
|
-
e.preventDefault();
|
|
63
|
-
navigateToDetails(item);
|
|
64
|
-
trackViewDetails();
|
|
65
|
-
}}
|
|
66
|
-
variant={detailsButtonVariant}
|
|
67
|
-
className={"map-details-button"}
|
|
68
|
-
size={buttonSize}
|
|
69
|
-
>
|
|
70
|
-
{detailsText}
|
|
71
|
-
</Button.Anchor>
|
|
72
|
-
}
|
|
73
|
-
{detailsUrl && useDetailsPostMessage !== true && navigateToDetails === null &&
|
|
74
|
-
<Button.Anchor
|
|
75
|
-
href={detailsUrl}
|
|
76
|
-
variant={detailsButtonVariant}
|
|
77
|
-
className={"map-details-button"}
|
|
78
|
-
size={buttonSize}
|
|
79
|
-
onClick={trackViewDetails}
|
|
80
|
-
>
|
|
81
|
-
{detailsText}
|
|
82
|
-
</Button.Anchor>
|
|
83
|
-
}
|
|
84
|
-
{useDetailsPostMessage === true && navigateToDetails === null &&
|
|
85
|
-
<Button.Btn
|
|
86
|
-
onClick={() => {trackViewDetails; window.parent.postMessage({ itemId: itemId, type: 'LISTING_ID' }, '*'); }}
|
|
87
|
-
variant={detailsButtonVariant}
|
|
88
|
-
className={"map-details-button"}
|
|
89
|
-
size={buttonSize}
|
|
90
|
-
>
|
|
91
|
-
{detailsText}
|
|
92
|
-
</Button.Btn>}
|
|
93
|
-
{applyUrl && !includeDialog && navigateToEasyApply == null &&
|
|
94
|
-
<Button.Anchor
|
|
95
|
-
href={applyUrl}
|
|
96
|
-
variant={applyButtonVariant}
|
|
97
|
-
size={buttonSize}
|
|
98
|
-
className={"map-apply-now-button"}
|
|
99
|
-
onClick={trackApply}
|
|
100
|
-
>
|
|
101
|
-
{applyText}
|
|
102
|
-
</Button.Anchor>
|
|
103
|
-
}
|
|
104
|
-
{applyUrl && !includeDialog && navigateToEasyApply != null &&
|
|
105
|
-
<Button.Btn
|
|
106
|
-
onClick={() => { navigateToEasyApply(item); trackApply(); }}
|
|
107
|
-
variant={applyButtonVariant}
|
|
108
|
-
className={"map-apply-now-button"}
|
|
109
|
-
size={buttonSize}
|
|
110
|
-
>
|
|
111
|
-
{applyText}
|
|
112
|
-
</Button.Btn>
|
|
113
|
-
}
|
|
114
|
-
{applyUrl && includeDialog &&
|
|
115
|
-
<ApplyDialog applyUrl={applyUrl} internalApplyLink={internalApplyLink} companyName={companyName}>
|
|
116
|
-
<Button.Anchor
|
|
117
|
-
variant={applyButtonVariant}
|
|
118
|
-
size={buttonSize}
|
|
119
|
-
className={"map-apply-now-button"}
|
|
120
|
-
onClick={trackApply}
|
|
121
|
-
>
|
|
122
|
-
{applyText}
|
|
123
|
-
</Button.Anchor>
|
|
124
|
-
</ApplyDialog>
|
|
125
|
-
}
|
|
126
|
-
</nav>
|
|
127
|
-
);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default ButtonGroupApply;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
import Button from '~/components/modules/buttons/default';
|
|
5
|
+
import ApplyDialog from '../dialogs/apply-dialog';
|
|
6
|
+
|
|
7
|
+
const ButtonGroupApply = ({
|
|
8
|
+
applyUrl,
|
|
9
|
+
useDetailsPostMessage,
|
|
10
|
+
navigateToDetails,
|
|
11
|
+
navigateToEasyApply,
|
|
12
|
+
Link,
|
|
13
|
+
linkFormat,
|
|
14
|
+
applyText = 'Apply Now',
|
|
15
|
+
detailsUrl,
|
|
16
|
+
detailsText = 'View Details',
|
|
17
|
+
className,
|
|
18
|
+
buttonSize = 'sm',
|
|
19
|
+
applyButtonVariant = 'primary',
|
|
20
|
+
detailsButtonVariant = 'outline',
|
|
21
|
+
includeDialog = false,
|
|
22
|
+
internalApplyLink,
|
|
23
|
+
itemId,
|
|
24
|
+
item,
|
|
25
|
+
companyName,
|
|
26
|
+
trackEvent,
|
|
27
|
+
eventTypes
|
|
28
|
+
}) => {
|
|
29
|
+
const href = linkFormat.replace('[slug]', item.slug ?? item.id);
|
|
30
|
+
|
|
31
|
+
const trackApply = () => {
|
|
32
|
+
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const trackViewDetails = () => {
|
|
36
|
+
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobTitle: item.fields.position, jobCategory: item.fields.category, entityDisplayName: item?.mapDetails?.entityDisplayName });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<nav
|
|
41
|
+
className={twMerge`
|
|
42
|
+
hc-flex hc-flex-row hc-justify-between hc-gap-2 hc-w-full
|
|
43
|
+
${className ?? ''}
|
|
44
|
+
`}
|
|
45
|
+
>
|
|
46
|
+
{Link &&
|
|
47
|
+
<Button.Link
|
|
48
|
+
Link={Link}
|
|
49
|
+
href={href}
|
|
50
|
+
variant={detailsButtonVariant}
|
|
51
|
+
size={buttonSize}
|
|
52
|
+
className={"map-details-button"}
|
|
53
|
+
onClick={trackViewDetails}
|
|
54
|
+
>
|
|
55
|
+
{detailsText}
|
|
56
|
+
</Button.Link>
|
|
57
|
+
}
|
|
58
|
+
{navigateToDetails &&
|
|
59
|
+
<Button.Anchor
|
|
60
|
+
href={href}
|
|
61
|
+
onClick={e => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
navigateToDetails(item);
|
|
64
|
+
trackViewDetails();
|
|
65
|
+
}}
|
|
66
|
+
variant={detailsButtonVariant}
|
|
67
|
+
className={"map-details-button"}
|
|
68
|
+
size={buttonSize}
|
|
69
|
+
>
|
|
70
|
+
{detailsText}
|
|
71
|
+
</Button.Anchor>
|
|
72
|
+
}
|
|
73
|
+
{detailsUrl && useDetailsPostMessage !== true && navigateToDetails === null &&
|
|
74
|
+
<Button.Anchor
|
|
75
|
+
href={detailsUrl}
|
|
76
|
+
variant={detailsButtonVariant}
|
|
77
|
+
className={"map-details-button"}
|
|
78
|
+
size={buttonSize}
|
|
79
|
+
onClick={trackViewDetails}
|
|
80
|
+
>
|
|
81
|
+
{detailsText}
|
|
82
|
+
</Button.Anchor>
|
|
83
|
+
}
|
|
84
|
+
{useDetailsPostMessage === true && navigateToDetails === null &&
|
|
85
|
+
<Button.Btn
|
|
86
|
+
onClick={() => {trackViewDetails; window.parent.postMessage({ itemId: itemId, type: 'LISTING_ID' }, '*'); }}
|
|
87
|
+
variant={detailsButtonVariant}
|
|
88
|
+
className={"map-details-button"}
|
|
89
|
+
size={buttonSize}
|
|
90
|
+
>
|
|
91
|
+
{detailsText}
|
|
92
|
+
</Button.Btn>}
|
|
93
|
+
{applyUrl && !includeDialog && navigateToEasyApply == null &&
|
|
94
|
+
<Button.Anchor
|
|
95
|
+
href={applyUrl}
|
|
96
|
+
variant={applyButtonVariant}
|
|
97
|
+
size={buttonSize}
|
|
98
|
+
className={"map-apply-now-button"}
|
|
99
|
+
onClick={trackApply}
|
|
100
|
+
>
|
|
101
|
+
{applyText}
|
|
102
|
+
</Button.Anchor>
|
|
103
|
+
}
|
|
104
|
+
{applyUrl && !includeDialog && navigateToEasyApply != null &&
|
|
105
|
+
<Button.Btn
|
|
106
|
+
onClick={() => { navigateToEasyApply(item); trackApply(); }}
|
|
107
|
+
variant={applyButtonVariant}
|
|
108
|
+
className={"map-apply-now-button"}
|
|
109
|
+
size={buttonSize}
|
|
110
|
+
>
|
|
111
|
+
{applyText}
|
|
112
|
+
</Button.Btn>
|
|
113
|
+
}
|
|
114
|
+
{applyUrl && includeDialog &&
|
|
115
|
+
<ApplyDialog applyUrl={applyUrl} internalApplyLink={internalApplyLink} companyName={companyName}>
|
|
116
|
+
<Button.Anchor
|
|
117
|
+
variant={applyButtonVariant}
|
|
118
|
+
size={buttonSize}
|
|
119
|
+
className={"map-apply-now-button"}
|
|
120
|
+
onClick={trackApply}
|
|
121
|
+
>
|
|
122
|
+
{applyText}
|
|
123
|
+
</Button.Anchor>
|
|
124
|
+
</ApplyDialog>
|
|
125
|
+
}
|
|
126
|
+
</nav>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default ButtonGroupApply;
|
|
@@ -235,7 +235,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
235
235
|
const keys = Object.keys(tempSelectedFilters);
|
|
236
236
|
const lastKey = keys[keys.length - 1];
|
|
237
237
|
const options = generateFilterOptions(
|
|
238
|
-
|
|
238
|
+
filteredListings,
|
|
239
239
|
allListings,
|
|
240
240
|
siteConfig,
|
|
241
241
|
filterOptions,
|