@abcagency/hc-ui-components 1.3.21 → 1.3.23

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 (149) hide show
  1. package/dist/components/containers/accordions/filter-container.js +4 -2
  2. package/dist/components/containers/accordions/filter-container.js.map +1 -1
  3. package/dist/components/containers/accordions/filter-item-container.js +6 -1
  4. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  5. package/dist/components/containers/accordions/map-accordion-item-container.js +4 -2
  6. package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
  7. package/dist/components/containers/jobListing/listing-details-container.js +2 -2
  8. package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
  9. package/dist/components/containers/list/item-list-container.js +2 -2
  10. package/dist/components/containers/list/item-list-container.js.map +1 -1
  11. package/dist/components/modules/accordions/MapAccordionItem.js +2 -1
  12. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  13. package/dist/components/modules/dialogs/apply-dialog.js +1 -1
  14. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  15. package/dist/components/modules/filter/search.js +1 -1
  16. package/dist/components/modules/filter/search.js.map +1 -1
  17. package/dist/components/modules/jobListing/listing-details.js +5 -4
  18. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  19. package/dist/components/modules/list/field-mapper.js +1 -1
  20. package/dist/components/modules/list/field-mapper.js.map +1 -1
  21. package/dist/components/modules/list/item-list.js.map +1 -1
  22. package/dist/contexts/mapListContext.js.map +1 -1
  23. package/dist/services/listingAggregatorService.js.map +1 -1
  24. package/dist/styles/index.css +3 -1
  25. package/dist/types/components/containers/jobListing/listing-details-container.d.ts +2 -2
  26. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +2 -1
  27. package/dist/types/components/modules/jobListing/listing-details.d.ts +2 -2
  28. package/dist/types/components/modules/list/item-list.d.ts +0 -1
  29. package/dist/types/types/ListingFields.d.ts +5 -0
  30. package/dist/types/types/config/MapConfig.d.ts +1 -0
  31. package/dist/util/filterUtil.js +2 -2
  32. package/dist/util/filterUtil.js.map +1 -1
  33. package/package.json +4 -1
  34. package/.env +0 -3
  35. package/.eslintrc +0 -136
  36. package/bundle.js +0 -28134
  37. package/bundle.js.map +0 -1
  38. package/bundleDist.map +0 -1
  39. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
  40. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
  41. package/jsconfig.json +0 -7
  42. package/postcss.config.js +0 -13
  43. package/preset.default.js +0 -15
  44. package/rollup.config.mjs +0 -111
  45. package/src/.editorconfig +0 -12
  46. package/src/apis/hcApi.ts +0 -109
  47. package/src/bundleIndex.js +0 -14
  48. package/src/clientToken.js +0 -9
  49. package/src/components/HireControlMap.js +0 -135
  50. package/src/components/containers/accordions/filter-container.js +0 -47
  51. package/src/components/containers/accordions/filter-item-container.js +0 -62
  52. package/src/components/containers/accordions/map-accordion-item-container.js +0 -70
  53. package/src/components/containers/filter/commute-container.js +0 -89
  54. package/src/components/containers/filter/filter-container.js +0 -76
  55. package/src/components/containers/filter/filter-item-container.js +0 -71
  56. package/src/components/containers/filter/location-container.js +0 -45
  57. package/src/components/containers/filter/points-of-interest-container.js +0 -33
  58. package/src/components/containers/filter/points-of-interest-radio-item-container.js +0 -35
  59. package/src/components/containers/filter/search-container.js +0 -50
  60. package/src/components/containers/jobListing/listing-details-container.js +0 -40
  61. package/src/components/containers/list/item-list-container.tsx +0 -82
  62. package/src/components/containers/list/list-item/list-item-container.js +0 -43
  63. package/src/components/containers/maps/info-window-content-container.js +0 -51
  64. package/src/components/containers/maps/map-container.js +0 -204
  65. package/src/components/containers/maps/map-list-container.js +0 -48
  66. package/src/components/containers/maps/map-marker-container.js +0 -78
  67. package/src/components/modules/accordions/MapAccordionItem.js +0 -29
  68. package/src/components/modules/accordions/default.js +0 -171
  69. package/src/components/modules/accordions/filterItem.js +0 -27
  70. package/src/components/modules/accordions/filters.js +0 -32
  71. package/src/components/modules/buttons/button-group-apply.js +0 -123
  72. package/src/components/modules/buttons/commute-pill.js +0 -22
  73. package/src/components/modules/buttons/default.js +0 -194
  74. package/src/components/modules/buttons/items-pill.js +0 -35
  75. package/src/components/modules/buttons/pill-wrapper.js +0 -27
  76. package/src/components/modules/buttons/show-all-button.js +0 -20
  77. package/src/components/modules/cards/default.js +0 -167
  78. package/src/components/modules/cards/filter.js +0 -56
  79. package/src/components/modules/dialogs/apply-dialog.js +0 -48
  80. package/src/components/modules/filter/commute.js +0 -108
  81. package/src/components/modules/filter/index.js +0 -55
  82. package/src/components/modules/filter/item.js +0 -48
  83. package/src/components/modules/filter/location.js +0 -48
  84. package/src/components/modules/filter/radio-item.js +0 -42
  85. package/src/components/modules/filter/search.js +0 -65
  86. package/src/components/modules/filter/sort.js +0 -83
  87. package/src/components/modules/grid.js +0 -54
  88. package/src/components/modules/icon.js +0 -33
  89. package/src/components/modules/jobListing/listing-details.js +0 -109
  90. package/src/components/modules/list/field-mapper.js +0 -114
  91. package/src/components/modules/list/header-item.js +0 -91
  92. package/src/components/modules/list/header.js +0 -49
  93. package/src/components/modules/list/item-expand-card/index.js +0 -22
  94. package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +0 -50
  95. package/src/components/modules/list/item-expand-card/recruiter-details.js +0 -68
  96. package/src/components/modules/list/item-expand-card/recruiter-headshot.js +0 -22
  97. package/src/components/modules/list/item-list.tsx +0 -85
  98. package/src/components/modules/list/list-item/list-item.js +0 -130
  99. package/src/components/modules/maps/info-window-card.js +0 -17
  100. package/src/components/modules/maps/info-window-content.js +0 -35
  101. package/src/components/modules/maps/map-list.js +0 -28
  102. package/src/components/modules/maps/map-marker.js +0 -29
  103. package/src/components/modules/maps/map.js +0 -76
  104. package/src/components/modules/maps/place-marker.js +0 -41
  105. package/src/components/modules/maps/tabs.js +0 -81
  106. package/src/constants/eventTypes.js +0 -13
  107. package/src/constants/placeTypes.js +0 -8
  108. package/src/contexts/mapContext.tsx +0 -129
  109. package/src/contexts/mapListContext.tsx +0 -311
  110. package/src/contexts/placesContext.js +0 -102
  111. package/src/contexts/trackEventContext.js +0 -14
  112. package/src/enums/SectionType.ts +0 -9
  113. package/src/hooks/useList.js +0 -89
  114. package/src/index.js +0 -3
  115. package/src/services/configService.ts +0 -16
  116. package/src/services/googlePlacesNearbyService.ts +0 -42
  117. package/src/services/listingAggregatorService.ts +0 -76
  118. package/src/services/listingEntityService.ts +0 -16
  119. package/src/services/listingService.ts +0 -40
  120. package/src/services/recruiterService.ts +0 -18
  121. package/src/styles/bundle.css +0 -268
  122. package/src/styles/index.css +0 -125
  123. package/src/types/Address.ts +0 -7
  124. package/src/types/ContentSection.ts +0 -9
  125. package/src/types/GetListingParams.ts +0 -8
  126. package/src/types/LatLng.ts +0 -4
  127. package/src/types/ListingEntity.ts +0 -11
  128. package/src/types/ListingFields.ts +0 -20
  129. package/src/types/Listings.ts +0 -32
  130. package/src/types/Recruiter.ts +0 -9
  131. package/src/types/SimilarListing.ts +0 -24
  132. package/src/types/config/Colors.ts +0 -8
  133. package/src/types/config/MapConfig.ts +0 -30
  134. package/src/types/config/PointsOfInterestConfig.ts +0 -13
  135. package/src/types/config/SearchConfig.ts +0 -4
  136. package/src/util/arrayUtil.js +0 -3
  137. package/src/util/fieldMapper.js +0 -22
  138. package/src/util/filterUtil.js +0 -239
  139. package/src/util/loading.js +0 -17
  140. package/src/util/localStorageUtil.ts +0 -34
  141. package/src/util/mapIconUtil.js +0 -180
  142. package/src/util/mapUtil.js +0 -91
  143. package/src/util/sortUtil.js +0 -33
  144. package/src/util/stringUtils.js +0 -6
  145. package/src/util/urlFilterUtil.js +0 -85
  146. package/stats.html +0 -4842
  147. package/styles/index.css +0 -1
  148. package/tailwind.config.js +0 -129
  149. package/tsconfig.json +0 -23
@@ -1,114 +0,0 @@
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 => {
31
- let value = item.fields[field];
32
- return (
33
- <Grid.Item
34
- key={field}
35
- className={`
36
- hc-hidden md:hc-block
37
- ${field.toLowerCase() === "position" ? "hc-col-span-2 hc-text-balance hc-pr-2 hc-font-semibold" : "hc-col-span-1"}
38
- `}
39
- >
40
- <span className="hc-sr-only">{capitalize(field)}</span>
41
- {value}
42
- <br />
43
- {specialFeaturePills(field)}
44
- </Grid.Item>
45
- );
46
- })}
47
- <Grid.Item className="md:hc-hidden">
48
- {fieldsShown.includes("position") &&
49
- <>
50
- <div className="hc-flex hc-items-start">
51
- <div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"> {}
52
- <h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.position}</h3>
53
- {includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
54
- <Icon
55
- icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
56
- size="hc-size-3.5"
57
- iconClasses={isFavorite ? "hc-text-primary" : ""}
58
- className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer
59
- ${isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100"}
60
- `}
61
- onClick={e => handleFavouriteClick(e, item)}
62
- />
63
- </div>
64
- }
65
- </div>
66
- </div>
67
- {specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("position", true)} </div>}
68
- </>
69
- }
70
-
71
- <ul className="hc-space-y-2 hc-text-xs">
72
- {[
73
- {
74
- field: "category",
75
- name: "Category",
76
- icon: "icon-park-solid:tree-list"
77
- },
78
- {
79
- field: "schedule",
80
- name: "Schedule",
81
- icon: "gravity-ui:clock-fill"
82
- },
83
- {
84
- field: "cityState",
85
- name: "Location",
86
- icon: "fluent:location-16-filled"
87
- },
88
- {
89
- field: "travelTime",
90
- name: "Commute",
91
- icon: "ri:pin-distance-fill"
92
- }
93
- ].map(listItem => (
94
- (fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&
95
- <li
96
- key={listItem.field}
97
- className="hc-flex hc-gap-2"
98
- >
99
- <Icon
100
- icon={listItem.icon}
101
- size="hc-size-3.5"
102
- className="hc-text-uiAccent/30"
103
- />
104
- <span className="hc-sr-only">{listItem.name}</span>
105
- {item.fields[listItem.field]}
106
- </li>
107
- ))}
108
- </ul>
109
- </Grid.Item>
110
- </>
111
- );
112
- };
113
-
114
- export default FieldMapper;
@@ -1,91 +0,0 @@
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,49 +0,0 @@
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/list/header-item';
6
-
7
- const ListHeader = ({
8
- className,
9
- fieldsShown,
10
- fieldNames,
11
- fieldIsSortable = true,
12
- setSortSetting,
13
- sortSetting,
14
- includeFavorite = false
15
- }) => {
16
- return (
17
- <Grid
18
- columns="hc-grid-flow-col hc-auto-cols-fr"
19
- gap="hc-gap-0"
20
- isAnimated={false}
21
- className={twMerge`
22
- hc-hidden md:hc-grid hc-bg-uiAccent/10 hc-border-b hc-border-uiAccent/10 hc-sticky hc-top-0 hc-z-10
23
- ${className ?? ""}
24
- `}
25
- >
26
- {fieldsShown.map(field => (
27
- <HeaderItem
28
- key={field}
29
- isSortable={fieldIsSortable}
30
- sortSetting={sortSetting}
31
- field={field}
32
- setSortSetting={setSortSetting}
33
- >
34
- {fieldNames[field]}
35
- </HeaderItem>
36
- ))}
37
- { includeFavorite == true &&
38
- <HeaderItem key={"favorite"}
39
- isSortable={false}
40
- field={"favorite"}
41
- >
42
- Favorite
43
- </HeaderItem>
44
- }
45
- </Grid>
46
- );
47
- };
48
-
49
- export default ListHeader;
@@ -1,22 +0,0 @@
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 +0,0 @@
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,68 +0,0 @@
1
- import React from 'react';
2
- import { twMerge } from 'tailwind-merge';
3
-
4
- const RecruiterDetails = ({
5
- contactNav,
6
- className,
7
- children
8
- }) => {
9
- return (
10
- <div
11
- className={twMerge`
12
- hc-grow
13
- ${className ?? ''}
14
- `}
15
- >
16
- {children}
17
-
18
- {contactNav &&
19
- <div className="hc-inline-flex">
20
- {contactNav}
21
- </div>
22
- }
23
- </div>
24
- );
25
- };
26
-
27
- export const Title = ({
28
- as = 'h4',
29
- className,
30
- children
31
- }) => {
32
- const Container = as;
33
-
34
- return (
35
- <Container
36
- className={twMerge`
37
- hc-text-base hc-font-medium
38
- ${className ?? ''}
39
- `}
40
- >
41
- {children}
42
- </Container>
43
- );
44
- };
45
-
46
- export const Text = ({
47
- as = 'p',
48
- className,
49
- children
50
- }) => {
51
- const Container = as;
52
-
53
- return (
54
- <Container
55
- className={twMerge`
56
- hc-text-sm hc-text-uiText/60
57
- ${className ?? ''}
58
- `}
59
- >
60
- {children}
61
- </Container>
62
- );
63
- };
64
-
65
- RecruiterDetails.Title = Title;
66
- RecruiterDetails.Text = Text;
67
-
68
- export default RecruiterDetails;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
-
3
- const RecruiterHeadshot = ({
4
- image,
5
- alt,
6
- className,
7
- imageClassName
8
- }) => {
9
- return (
10
- <div className={className ?? ''}>
11
- <img
12
- src={image}
13
- width="96"
14
- height="96"
15
- alt={alt}
16
- className={imageClassName ?? ''}
17
- />
18
- </div>
19
- );
20
- };
21
-
22
- export default RecruiterHeadshot;
@@ -1,85 +0,0 @@
1
- import React, { RefObject, ReactNode } from 'react';
2
- import Header from '~/components/modules/list/header';
3
- import Sort from '~/components/modules/filter/sort';
4
- import Loading from "~/util/loading";
5
- import { Listing } from '~/types/Listings';
6
-
7
- interface ItemsListProps {
8
- fieldNames: Record<string, string>;
9
- showMap: boolean;
10
- fieldsShown: string[];
11
- filteredListings: Listing[];
12
- loading: boolean;
13
- sortSetting: any;
14
- setSortSetting: (setting: any) => void;
15
- itemLimit: number;
16
- loader: RefObject<HTMLDivElement>;
17
- scrollContainerRef: RefObject<HTMLDivElement>;
18
- itemRefs: any;
19
- selectedListItem: Listing | null;
20
- itemExpandedContent: (item: Listing, recruiters: any) => JSX.Element | null;
21
- children: ReactNode;
22
- includeFavorite: boolean;
23
- }
24
-
25
- const ItemsList: React.FC<ItemsListProps> = ({
26
- fieldNames,
27
- showMap,
28
- fieldsShown,
29
- filteredListings,
30
- loading,
31
- sortSetting,
32
- setSortSetting,
33
- itemLimit,
34
- loader,
35
- scrollContainerRef,
36
- includeFavorite = false,
37
- children
38
- }) => (
39
- <div className="hc-relative hc-bg-white md:hc-px-4 hc-flex hc-flex-col">
40
- <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">
41
- <h2 className="hc-text-gray-500 hc-font-semibold hc-text-xs md:hc-text-sm">
42
- {loading && <span>Loading...</span>}
43
- {!loading && <span>{filteredListings.length} results</span>}
44
- </h2>
45
- <div className="hc-block md:hc-hidden">
46
- <Sort
47
- className={''}
48
- fields={fieldsShown}
49
- setSortSetting={setSortSetting}
50
- fieldNames={fieldNames}
51
- />
52
- </div>
53
- </div>
54
- <div>
55
- <Header
56
- className={''}
57
- setSortSetting={setSortSetting}
58
- sortSetting={sortSetting}
59
- fieldsShown={fieldsShown}
60
- fieldNames={fieldNames}
61
- includeFavorite={includeFavorite}
62
- />
63
- </div>
64
- <div
65
- ref={scrollContainerRef}
66
- className={`
67
- hc-flex-grow hc-overflow-y-auto
68
- ${showMap ? "md:hc-max-h-45vh hc-max-h-[100vh]" : "md:hc-max-h-95vh hc-max-h-[95vh]"}
69
- `}
70
- >
71
- {loading ? (
72
- <div className="hc-flex hc-justify-center hc-items-center hc-pt-20">
73
- <Loading />
74
- </div>
75
- ) : (
76
- children
77
- )}
78
- <div ref={loader} style={{ height: "100px", textAlign: "center" }}>
79
- {filteredListings.length >= itemLimit && <Loading />}
80
- </div>
81
- </div>
82
- </div>
83
- );
84
-
85
- export default ItemsList;
@@ -1,130 +0,0 @@
1
- import React, { forwardRef, useState } from 'react';
2
- import Grid from '~/components/modules/grid';
3
- import Icon from '~/components/modules/icon';
4
- import FieldMapper from '~/components/modules/list/field-mapper';
5
-
6
- const ListItem = forwardRef(
7
- (
8
- {
9
- isActive,
10
- bodyClassName,
11
- className,
12
- item,
13
- fieldsShown,
14
- specialFeatures,
15
- onItemSelected,
16
- showMap,
17
- setMobileTab,
18
- handleSettingFavorites,
19
- favorites,
20
- includeFavorite = true,
21
- siteConfig,
22
- trackEvent,
23
- eventTypes,
24
- ...props
25
- },
26
- ref
27
- ) => {
28
- const mapPinColor = !showMap ? null : siteConfig.colors.primary.replace("#", "");
29
-
30
- const handleClick = () => {
31
- if (onItemSelected) {
32
- onItemSelected(item);
33
- }
34
- };
35
- let isFavorite = favorites.includes(item.id);
36
-
37
- const handleFavouriteClick = (event, item) => {
38
- if(!includeFavorite)return;
39
- event.stopPropagation();
40
- let updatedFavorites;
41
- if (isFavorite) {
42
- updatedFavorites = favorites.filter(fav => fav !== item.id);
43
- } else {
44
- updatedFavorites = [...favorites, item.id];
45
- }
46
- isFavorite = !isFavorite;
47
- handleSettingFavorites(updatedFavorites);
48
- };
49
- return (
50
- <button
51
- ref={ref}
52
- onClick={() => { handleClick(); }}
53
- className={`
54
- hc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5
55
- ${isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white"}
56
- ${className ?? ""}
57
- `}
58
- {...props}
59
- >
60
- <Grid
61
- columns="hc-grid-flow-col hc-auto-cols-fr"
62
- gap="hc-gap-2"
63
- isAnimated={false}
64
- className={`
65
- hc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm
66
- ${bodyClassName ?? ""}
67
- `}
68
- >
69
- <Grid.Item className="hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5">
70
- <span className="hc-sr-only">Expand row</span>
71
- <Icon
72
- icon="fluent-emoji-high-contrast:plus"
73
- size="hc-size-2.5"
74
- className={`
75
- hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100
76
- ${isActive ? "hc-opacity-100 hc-rotate-45" : ""}
77
- `}
78
- />
79
- </Grid.Item>
80
- <FieldMapper
81
- item={item}
82
- fieldsShown={fieldsShown}
83
- specialFeatures={specialFeatures}
84
- isFavorite={isFavorite}
85
- includeFavorite={includeFavorite}
86
- handleFavouriteClick={handleFavouriteClick}
87
- />
88
- {includeFavorite &&
89
- <Grid.Item
90
- key={"favorites"}
91
- className="hc-hidden md:hc-block hc-col-span-1"
92
- >
93
- <Icon
94
- icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
95
- size="hc-size-3.5"
96
- iconClasses={isFavorite ? "hc-text-primary" : ""}
97
- title={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}
98
- className="hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100"
99
- onClick={e => {handleFavouriteClick(e, item);}}
100
- />
101
- </Grid.Item>
102
- }
103
- </Grid>
104
- {showMap && (
105
- <div onClick={() => { setMobileTab("mapTab"); handleClick(); }} className="md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm">
106
- <img
107
- src={`https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails?.latitude},${item.mapDetails?.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails?.latitude},${item.mapDetails?.longitude}&key=${process.env.GOOGLE_MAPS_API_KEY}`}
108
- alt={`Map of location for ${item.fields.position}`}
109
- className="hc-w-full hc-h-full hc-object-cover"
110
- />
111
- </div>
112
- )}
113
- </button>
114
- );
115
- }
116
- );
117
-
118
- ListItem.displayName = "ListItem";
119
-
120
- export default React.memo(ListItem, (prevProps, nextProps) => {
121
- return (
122
- prevProps.isActive === nextProps.isActive &&
123
- prevProps.favorites === nextProps.favorites &&
124
- prevProps.item.id === nextProps.item.id &&
125
- prevProps.item.fields.travelTime === nextProps.item.fields.travelTime &&
126
- prevProps.fieldsShown === nextProps.fieldsShown &&
127
- prevProps.bodyClassName === nextProps.bodyClassName &&
128
- prevProps.className === nextProps.className
129
- );
130
- });
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
- const CardInfoWindow = ({ className, content, id }) => {
4
- return (
5
- <div
6
- id={id}
7
- className={`
8
- hc-relative hc-flex hc-flex-col hc-break-words hc-bg-clip-border
9
- ${className ?? ""}
10
- `}
11
- >
12
- {content}
13
- </div>
14
- );
15
- };
16
-
17
- export default CardInfoWindow;
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
-
3
- const InfoWindowContent = ({
4
- items,
5
- fullAddress,
6
- applyFilters
7
- }) => {
8
- if (!items || items.length < 0) {
9
- return null;
10
- }
11
- return (
12
- <div className="hc-flex-auto hc-p-2">
13
- <div>
14
- <div>
15
- <h4 className="hc-text-lg hc-font-bold hc-leading-tight hc-mb-3">
16
- {items[0].mapDetails?.entityDisplayName}
17
- </h4>
18
- <p>{fullAddress}</p>
19
- <div className="hc-pt-2">
20
- <button
21
- className="hc-cursor-pointer hover:hc-opacity-70 hc-text-primary"
22
- onClick={applyFilters}
23
- >
24
- {items.length > 1
25
- ? `View All ${items.length} jobs at this location`
26
- : `View job at this location`}
27
- </button>
28
- </div>
29
- </div>
30
- </div>
31
- </div>
32
- );
33
- };
34
-
35
- export default InfoWindowContent;