@abcagency/hc-ui-components 1.5.1 → 1.5.3
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 +52 -22
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/filter-container.js +13 -5
- package/dist/components/containers/accordions/filter-container.js.map +1 -1
- package/dist/components/containers/accordions/filter-item-container.js +9 -9
- package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
- package/dist/components/containers/accordions/map-accordion-item-container.js +10 -5
- package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
- package/dist/components/containers/filter/commute-container.js +3 -3
- package/dist/components/containers/filter/commute-container.js.map +1 -1
- package/dist/components/containers/filter/filter-container.js +6 -5
- package/dist/components/containers/filter/filter-container.js.map +1 -1
- package/dist/components/containers/filter/filter-item-container.js +12 -12
- package/dist/components/containers/filter/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js +6 -5
- package/dist/components/containers/filter/location-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-container.js +5 -5
- 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 +2 -2
- package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
- package/dist/components/containers/filter/search-container.js +2 -2
- package/dist/components/containers/filter/search-container.js.map +1 -1
- package/dist/components/containers/jobListing/listing-details-container.js +2 -2
- package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js +8 -8
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/components/containers/list/list-item/list-item-container.js +2 -2
- package/dist/components/containers/list/list-item/list-item-container.js.map +1 -1
- package/dist/components/containers/maps/info-window-content-container.js +2 -2
- package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +8 -9
- package/dist/components/containers/maps/map-container.js.map +1 -1
- package/dist/components/containers/maps/map-list-container.js +5 -5
- package/dist/components/containers/maps/map-list-container.js.map +1 -1
- package/dist/components/containers/maps/map-marker-container.js +6 -6
- package/dist/components/containers/maps/map-marker-container.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +5 -5
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/default.js +15 -15
- package/dist/components/modules/accordions/default.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js +4 -4
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js +6 -6
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +19 -19
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/default.js +9 -9
- package/dist/components/modules/buttons/default.js.map +1 -1
- package/dist/components/modules/buttons/items-pill.js +2 -2
- package/dist/components/modules/buttons/items-pill.js.map +1 -1
- package/dist/components/modules/buttons/pill-wrapper.js +2 -2
- package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
- package/dist/components/modules/buttons/show-all-button.js +3 -3
- package/dist/components/modules/buttons/show-all-button.js.map +1 -1
- package/dist/components/modules/cards/default.js +11 -11
- package/dist/components/modules/cards/default.js.map +1 -1
- package/dist/components/modules/cards/filter.js +5 -5
- package/dist/components/modules/cards/filter.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js +19 -19
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +18 -19
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js +10 -10
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/item.js +6 -6
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +6 -6
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +6 -6
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js +10 -10
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js +28 -28
- package/dist/components/modules/filter/sort.js.map +1 -1
- package/dist/components/modules/grid.js +4 -4
- package/dist/components/modules/grid.js.map +1 -1
- package/dist/components/modules/icon.js +4 -4
- package/dist/components/modules/icon.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +4 -4
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/list/field-mapper-desktop.js +8 -8
- package/dist/components/modules/list/field-mapper-desktop.js.map +1 -1
- package/dist/components/modules/list/field-mapper-mobile.js +18 -18
- package/dist/components/modules/list/field-mapper-mobile.js.map +1 -1
- package/dist/components/modules/list/header-item.js +7 -7
- package/dist/components/modules/list/header-item.js.map +1 -1
- package/dist/components/modules/list/header.js +5 -5
- package/dist/components/modules/list/header.js.map +1 -1
- package/dist/components/modules/list/item-expand-card/index.js +3 -3
- package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/list/item-list.js +15 -15
- package/dist/components/modules/list/item-list.js.map +1 -1
- package/dist/components/modules/list/list-item/list-item.js +13 -13
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/components/modules/maps/info-window-card.js +2 -2
- package/dist/components/modules/maps/info-window-card.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js +5 -5
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/map-list.js +5 -5
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +3 -3
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js +5 -5
- package/dist/components/modules/maps/map.js.map +1 -1
- package/dist/components/modules/maps/place-marker.js +5 -5
- package/dist/components/modules/maps/place-marker.js.map +1 -1
- package/dist/components/modules/maps/tabs.js +21 -21
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/contexts/mapContext.js +18 -18
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +28 -24
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js +2 -2
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/contexts/themeContext.js +2 -2
- package/dist/contexts/themeContext.js.map +1 -1
- package/dist/contexts/trackEventContext.js +2 -2
- package/dist/contexts/trackEventContext.js.map +1 -1
- package/dist/services/listingAggregatorService.js +19 -15
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/services/listingEntityService.js +3 -2
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js +1 -16
- package/dist/services/listingService.js.map +1 -1
- package/dist/styles/index.css +1 -3
- package/dist/types/contexts/mapContext.d.ts +1 -0
- package/dist/types/services/listingAggregatorService.d.ts +2 -2
- package/dist/types/services/listingEntityService.d.ts +2 -3
- package/dist/types/types/GetListingParams.d.ts +1 -1
- package/dist/types/types/ListingEntity.d.ts +2 -1
- package/dist/types/types/ListingFields.d.ts +4 -2
- package/dist/types/types/Listings.d.ts +0 -1
- package/dist/types/util/algoliaSearchUtil.d.ts +4 -0
- package/dist/types/util/filterUtil.d.ts +2 -2
- package/dist/types/util/mapUtil.d.ts +3 -3
- package/dist/util/algoliaSearchUtil.js +133 -0
- package/dist/util/algoliaSearchUtil.js.map +1 -0
- package/dist/util/filterUtil.js +129 -66
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/loading.js +3 -3
- package/dist/util/loading.js.map +1 -1
- package/dist/util/mapUtil.js +37 -25
- package/dist/util/mapUtil.js.map +1 -1
- package/package.json +60 -17
- package/src/components/HireControlMap.js +35 -9
- package/src/components/containers/accordions/filter-container.js +6 -1
- package/src/components/containers/accordions/filter-item-container.js +2 -2
- package/src/components/containers/accordions/map-accordion-item-container.js +6 -2
- package/src/components/containers/filter/filter-container.js +3 -2
- package/src/components/containers/filter/filter-item-container.js +10 -10
- package/src/components/containers/filter/location-container.js +3 -3
- package/src/components/containers/list/item-list-container.tsx +3 -3
- package/src/components/containers/maps/info-window-content-container.js +1 -1
- package/src/components/containers/maps/map-container.js +2 -1
- package/src/components/modules/buttons/button-group-apply.js +8 -8
- package/src/components/modules/dialogs/apply-dialog.js +2 -2
- package/src/components/modules/list/field-mapper-desktop.jsx +2 -2
- package/src/components/modules/list/field-mapper-mobile.jsx +8 -8
- package/src/components/modules/list/header-item.js +1 -1
- package/src/components/modules/maps/map-list.js +1 -1
- package/src/contexts/mapContext.tsx +17 -16
- package/src/contexts/mapListContext.tsx +55 -49
- package/src/services/listingAggregatorService.ts +29 -21
- package/src/services/listingEntityService.ts +3 -3
- package/src/services/listingService.ts +1 -11
- package/src/styles/components.css +30 -0
- package/src/types/GetListingParams.ts +1 -1
- package/src/types/ListingEntity.ts +2 -1
- package/src/types/ListingFields.ts +4 -2
- package/src/types/Listings.ts +0 -1
- package/src/util/algoliaSearchUtil.js +91 -0
- package/src/util/filterUtil.js +19 -8
- package/src/util/mapUtil.js +52 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcagency/hc-ui-components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "UI Components for HireControl",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
"author": "Aloysius Butler & Clark",
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"ajv": "^8.16.0",
|
|
28
|
+
"ajv-keywords": "^5.1.0",
|
|
29
|
+
"fuse.js": "^7.0.0",
|
|
30
|
+
"tailwind-merge": "^2.2.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
27
33
|
"@headlessui/react": "^1.7.19",
|
|
28
34
|
"@iconify/react": "^4.1.1",
|
|
29
35
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -32,25 +38,56 @@
|
|
|
32
38
|
"@radix-ui/react-select": "^2.0.0",
|
|
33
39
|
"@radix-ui/react-tabs": "^1.0.4",
|
|
34
40
|
"@react-google-maps/api": "^2.19.3",
|
|
35
|
-
"@testing-library/react": "^13.4.0",
|
|
36
|
-
"ajv": "^8.16.0",
|
|
37
|
-
"ajv-keywords": "^5.1.0",
|
|
38
41
|
"framer-motion": "^10.18.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
42
|
+
"react": ">=18.0.0",
|
|
43
|
+
"react-dom": ">=18.0.0",
|
|
41
44
|
"react-router-dom": "^6.23.1",
|
|
42
|
-
"react-scripts": "5.0.1",
|
|
43
45
|
"react-wrap-balancer": "^1.1.1",
|
|
44
|
-
"
|
|
45
|
-
"rollup-plugin-progress": "^1.1.2",
|
|
46
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
47
|
-
"tailwind-merge": "^2.2.0",
|
|
48
|
-
"use-places-autocomplete": "^4.0.1",
|
|
49
|
-
"web-vitals": "^2.1.4"
|
|
46
|
+
"use-places-autocomplete": "^4.0.1"
|
|
50
47
|
},
|
|
51
|
-
"
|
|
52
|
-
"react":
|
|
53
|
-
|
|
48
|
+
"peerDependenciesMeta": {
|
|
49
|
+
"@headlessui/react": {
|
|
50
|
+
"optional": false
|
|
51
|
+
},
|
|
52
|
+
"@iconify/react": {
|
|
53
|
+
"optional": false
|
|
54
|
+
},
|
|
55
|
+
"@radix-ui/react-accordion": {
|
|
56
|
+
"optional": false
|
|
57
|
+
},
|
|
58
|
+
"@radix-ui/react-dialog": {
|
|
59
|
+
"optional": false
|
|
60
|
+
},
|
|
61
|
+
"@radix-ui/react-popover": {
|
|
62
|
+
"optional": false
|
|
63
|
+
},
|
|
64
|
+
"@radix-ui/react-select": {
|
|
65
|
+
"optional": false
|
|
66
|
+
},
|
|
67
|
+
"@radix-ui/react-tabs": {
|
|
68
|
+
"optional": false
|
|
69
|
+
},
|
|
70
|
+
"@react-google-maps/api": {
|
|
71
|
+
"optional": false
|
|
72
|
+
},
|
|
73
|
+
"framer-motion": {
|
|
74
|
+
"optional": false
|
|
75
|
+
},
|
|
76
|
+
"react": {
|
|
77
|
+
"optional": false
|
|
78
|
+
},
|
|
79
|
+
"react-dom": {
|
|
80
|
+
"optional": false
|
|
81
|
+
},
|
|
82
|
+
"react-router-dom": {
|
|
83
|
+
"optional": false
|
|
84
|
+
},
|
|
85
|
+
"react-wrap-balancer": {
|
|
86
|
+
"optional": false
|
|
87
|
+
},
|
|
88
|
+
"use-places-autocomplete": {
|
|
89
|
+
"optional": false
|
|
90
|
+
}
|
|
54
91
|
},
|
|
55
92
|
"devDependencies": {
|
|
56
93
|
"@babel/cli": "^7.24.6",
|
|
@@ -68,8 +105,9 @@
|
|
|
68
105
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
69
106
|
"@tailwindcss/forms": "^0.5.7",
|
|
70
107
|
"@tailwindcss/typography": "^0.5.13",
|
|
108
|
+
"@testing-library/react": "^16.0.0",
|
|
71
109
|
"@types/node": "^20.14.2",
|
|
72
|
-
"@types/react": "^
|
|
110
|
+
"@types/react": "^19.0.0",
|
|
73
111
|
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
74
112
|
"@typescript-eslint/parser": "^7.13.0",
|
|
75
113
|
"autoprefixer": "^10.4.19",
|
|
@@ -86,9 +124,14 @@
|
|
|
86
124
|
"postcss": "^8.4.38",
|
|
87
125
|
"postcss-prefixer": "^3.0.0",
|
|
88
126
|
"postcss-preset-env": "^9.5.14",
|
|
127
|
+
"react": "19.1.1",
|
|
128
|
+
"react-dom": "19.1.1",
|
|
89
129
|
"rollup": "^4.18.0",
|
|
130
|
+
"rollup-plugin-filesize": "^10.0.0",
|
|
90
131
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
91
132
|
"rollup-plugin-postcss": "^4.0.2",
|
|
133
|
+
"rollup-plugin-progress": "^1.1.2",
|
|
134
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
92
135
|
"tailwindcss": "^3.4.3",
|
|
93
136
|
"tailwindcss-animate": "^1.0.7",
|
|
94
137
|
"typescript": "^4.9.5"
|
|
@@ -14,8 +14,9 @@ import { ThemeProvider } from '~/contexts/themeContext';
|
|
|
14
14
|
|
|
15
15
|
import { getMapConfig } from '~/services/configService';
|
|
16
16
|
import { setClientAuthKey } from '~/clientToken.js';
|
|
17
|
+
import { initializeAlgoliaSearch } from '~/util/algoliaSearchUtil';
|
|
17
18
|
|
|
18
|
-
import '../styles/
|
|
19
|
+
import '../styles/components.css';
|
|
19
20
|
|
|
20
21
|
// Libraries for Google Maps
|
|
21
22
|
const LIBRARIES = ['places'];
|
|
@@ -59,7 +60,7 @@ const ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey,
|
|
|
59
60
|
secondaryDark={siteConfig.colors.secondaryDark}
|
|
60
61
|
>
|
|
61
62
|
<MapListProvider siteConfig={siteConfig} {...mapListProps}>
|
|
62
|
-
<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride}>
|
|
63
|
+
<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride} localStorageKey={mapListProps.localStorageKey}>
|
|
63
64
|
<PlacesProvider
|
|
64
65
|
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
65
66
|
additionalMapMarkers={mapListProps.additionalMapMarkers}
|
|
@@ -98,6 +99,9 @@ export const HireControlMap = ({
|
|
|
98
99
|
easyApplyUrl = null,
|
|
99
100
|
easyApplyText = 'Easy Apply',
|
|
100
101
|
isIframe = false,
|
|
102
|
+
hideMap = false, // Override to hide map even if siteConfig.showMap is true
|
|
103
|
+
hideFilters = false, // Hide the entire filter section
|
|
104
|
+
noEntities = false, // Skip entity fetching and hide entity-related filters
|
|
101
105
|
trackEvent = (eventType, eventObj) => {
|
|
102
106
|
console.log(eventType);
|
|
103
107
|
console.log(eventObj);
|
|
@@ -114,11 +118,25 @@ export const HireControlMap = ({
|
|
|
114
118
|
defaultZoomOverride = null,
|
|
115
119
|
//Default site configuration file passed here stops need to fetch from api
|
|
116
120
|
siteConfiguration = null,
|
|
117
|
-
localStorageKey = 'defaultKey.'
|
|
121
|
+
localStorageKey = 'defaultKey.',
|
|
122
|
+
// Algolia search configuration (optional)
|
|
123
|
+
algoliaAppId = null,
|
|
124
|
+
algoliaApiKey = null,
|
|
125
|
+
algoliaIndexName = null
|
|
118
126
|
}) => {
|
|
119
127
|
// Load site configuration
|
|
120
128
|
const { siteConfig, error } = useSiteConfig(clientToken, siteConfiguration);
|
|
121
129
|
|
|
130
|
+
// Initialize Algolia if credentials are provided
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (algoliaAppId && algoliaApiKey && algoliaIndexName) {
|
|
133
|
+
const initialized = initializeAlgoliaSearch(algoliaAppId, algoliaApiKey, algoliaIndexName);
|
|
134
|
+
if (initialized) {
|
|
135
|
+
console.log('Algolia search initialized successfully');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, [algoliaAppId, algoliaApiKey, algoliaIndexName]);
|
|
139
|
+
|
|
122
140
|
// Load Google Maps
|
|
123
141
|
const { isLoaded: isMapsLoaded, loadError } = useLoadScript({
|
|
124
142
|
googleMapsApiKey: googleMapsApiKey,
|
|
@@ -167,9 +185,15 @@ export const HireControlMap = ({
|
|
|
167
185
|
ExpandListComponent: ExpandListComponent ?? null,
|
|
168
186
|
additionalMapMarkers,
|
|
169
187
|
isIframe,
|
|
170
|
-
localStorageKey
|
|
188
|
+
localStorageKey,
|
|
189
|
+
hideMap,
|
|
190
|
+
hideFilters,
|
|
191
|
+
noEntities
|
|
171
192
|
};
|
|
172
193
|
|
|
194
|
+
// Calculate effective showMap value (hideMap overrides siteConfig.showMap)
|
|
195
|
+
const effectiveShowMap = hideMap ? false : siteConfig.showMap;
|
|
196
|
+
|
|
173
197
|
// Prepare marker configuration
|
|
174
198
|
const markerConfigs = {
|
|
175
199
|
fillColor: siteConfig.colors.primary,
|
|
@@ -192,18 +216,20 @@ export const HireControlMap = ({
|
|
|
192
216
|
<Grid
|
|
193
217
|
as='section'
|
|
194
218
|
id='job-search-interface'
|
|
195
|
-
columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
|
|
219
|
+
columns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}
|
|
196
220
|
gap='hc-gap-0'
|
|
197
221
|
autoRows={false}
|
|
198
222
|
className={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}
|
|
199
223
|
>
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
224
|
+
{!hideFilters && (
|
|
225
|
+
<Grid.Item className='hc-bg-gray-100'>
|
|
226
|
+
<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />
|
|
227
|
+
</Grid.Item>
|
|
228
|
+
)}
|
|
203
229
|
<MapList
|
|
204
230
|
containerStyle={containerStyle}
|
|
205
231
|
mapPosition={siteConfig.mapPosition}
|
|
206
|
-
showMap={
|
|
232
|
+
showMap={effectiveShowMap}
|
|
207
233
|
fieldsShown={siteConfig.fieldsShown}
|
|
208
234
|
specialFeatures={siteConfig.specialFeatures}
|
|
209
235
|
fieldNames={siteConfig.fieldNames}
|
|
@@ -12,7 +12,7 @@ const AccordionFiltersContainer = ({
|
|
|
12
12
|
setSelectedListItem,
|
|
13
13
|
SubcategoryRequireCategory
|
|
14
14
|
}) => {
|
|
15
|
-
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters } = useMapList();
|
|
15
|
+
const { filterOptions, selectedFilters, setSelectedFilters, siteConfig, hiddenFilters, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const handleSetSelectedFilters = prevFilters => {
|
|
18
18
|
setSelectedFilters(prevFilters);
|
|
@@ -25,6 +25,11 @@ const AccordionFiltersContainer = ({
|
|
|
25
25
|
displayedFilters = filterOptions?.filters.filter(filter => !hiddenFilters.includes(filter.id));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Hide entity-dependent filters when noEntities is true
|
|
29
|
+
if (noEntities && displayedFilters) {
|
|
30
|
+
displayedFilters = displayedFilters.filter(filter => filter.id !== 'entityName');
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
return (
|
|
29
34
|
<AccordionFilters
|
|
30
35
|
className={className}
|
|
@@ -21,8 +21,8 @@ const FilterItemContainer = ({
|
|
|
21
21
|
event.stopPropagation();
|
|
22
22
|
setSelectedFilters(prevFilters => {
|
|
23
23
|
const updatedFilters = { ...prevFilters };
|
|
24
|
-
if(subcategoryRequireCategory && fieldKey == '
|
|
25
|
-
delete updatedFilters['
|
|
24
|
+
if(subcategoryRequireCategory && fieldKey == 'category'){
|
|
25
|
+
delete updatedFilters['subCategory'];
|
|
26
26
|
}
|
|
27
27
|
if(fieldKey == 'state' || fieldKey == 'city' || fieldKey == 'cityState'){
|
|
28
28
|
delete updatedFilters.entityId;
|
|
@@ -25,7 +25,11 @@ const MapAccordionItemContainer = ({
|
|
|
25
25
|
selectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });
|
|
26
26
|
} else {
|
|
27
27
|
setStorageObject("selectedListItem", item);
|
|
28
|
-
|
|
28
|
+
console.log('mapItems here', mapItems);
|
|
29
|
+
//edited here for new structure of entity key
|
|
30
|
+
console.log('the item in questions is',item);
|
|
31
|
+
const location = mapItems.find(x => x.entityKey?.toLowerCase() === item.fields.entityKey?.toLowerCase()) || null;
|
|
32
|
+
console.log('location is', location);
|
|
29
33
|
selectItem(item, location, 12, {
|
|
30
34
|
lat: location?.latitude,
|
|
31
35
|
lng: location?.longitude
|
|
@@ -35,7 +39,7 @@ const MapAccordionItemContainer = ({
|
|
|
35
39
|
|
|
36
40
|
const handleItemClick = item => {
|
|
37
41
|
trackEvent(eventTypes.JOB_LISTING_SELECTED, {
|
|
38
|
-
jobTitle: item.fields.
|
|
42
|
+
jobTitle: item.fields.title,
|
|
39
43
|
jobCategory: item.fields.category,
|
|
40
44
|
entityDisplayName: item?.mapDetails?.entityDisplayName
|
|
41
45
|
});
|
|
@@ -24,7 +24,8 @@ const FilterContainer = ({
|
|
|
24
24
|
handleSettingFavorites,
|
|
25
25
|
setQuery,
|
|
26
26
|
siteConfig,
|
|
27
|
-
containerStyle
|
|
27
|
+
containerStyle,
|
|
28
|
+
noEntities
|
|
28
29
|
} = useMapList();
|
|
29
30
|
const [defaultValue, setDefaultValue] = useState(siteConfig?.defaultFilterOpen ? siteConfig?.defaultFilterOpen : null);
|
|
30
31
|
const handleReset = () => {
|
|
@@ -64,7 +65,7 @@ const FilterContainer = ({
|
|
|
64
65
|
SubcategoryRequireCategory={siteConfig.subcategoryRequireCategory}
|
|
65
66
|
/>
|
|
66
67
|
<FilterSearch />
|
|
67
|
-
{siteConfig.hideLocations !== true &&
|
|
68
|
+
{siteConfig.hideLocations !== true && !noEntities &&
|
|
68
69
|
<FilterLocations
|
|
69
70
|
setHasActiveFilters={setHasActiveFilters}
|
|
70
71
|
defaultValue={defaultValue}
|
|
@@ -55,30 +55,30 @@ const FilterItemContainer = ({
|
|
|
55
55
|
delete updatedFilters[field];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (field === '
|
|
58
|
+
if (field === 'category' && subcategoryRequireCategory) {
|
|
59
59
|
const activeCategoryClass = itemKey;
|
|
60
60
|
const categoriesToConsiderForRemoval = new Set(
|
|
61
61
|
filteredListings
|
|
62
|
-
.filter(listing => listing.fields.
|
|
63
|
-
.flatMap(listing => listing.fields.
|
|
62
|
+
.filter(listing => listing.fields.category === activeCategoryClass)
|
|
63
|
+
.flatMap(listing => listing.fields.subCategory || [])
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
const categoriesToRetain = new Set(
|
|
67
67
|
filteredListings
|
|
68
|
-
.filter(listing => listing.fields.
|
|
69
|
-
.flatMap(listing => listing.fields.
|
|
68
|
+
.filter(listing => listing.fields.category !== activeCategoryClass)
|
|
69
|
+
.flatMap(listing => listing.fields.subCategory || [])
|
|
70
70
|
.filter(category => categoriesToConsiderForRemoval.has(category))
|
|
71
71
|
);
|
|
72
72
|
|
|
73
|
-
if (updatedFilters['
|
|
74
|
-
Object.keys(updatedFilters['
|
|
73
|
+
if (updatedFilters['subCategory']) {
|
|
74
|
+
Object.keys(updatedFilters['subCategory']).forEach(categoryKey => {
|
|
75
75
|
if (categoriesToConsiderForRemoval.has(categoryKey) && !categoriesToRetain.has(categoryKey)) {
|
|
76
|
-
delete updatedFilters['
|
|
76
|
+
delete updatedFilters['subCategory'][categoryKey];
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
if (Object.keys(updatedFilters['
|
|
81
|
-
delete updatedFilters['
|
|
80
|
+
if (Object.keys(updatedFilters['subCategory']).length === 0) {
|
|
81
|
+
delete updatedFilters['subCategory'];
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -12,7 +12,7 @@ const FilterLocationContainer = ({
|
|
|
12
12
|
setLocation,
|
|
13
13
|
setSelectedListItem
|
|
14
14
|
}) => {
|
|
15
|
-
const { setSelectedFilters, selectedFilters, filterOptions } = useMapList();
|
|
15
|
+
const { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();
|
|
16
16
|
|
|
17
17
|
const locations = filterOptions?.locations;
|
|
18
18
|
const pointsOfInterest = filterOptions?.pointsOfInterest;
|
|
@@ -29,8 +29,8 @@ const FilterLocationContainer = ({
|
|
|
29
29
|
setSelectedFilters={setSelectedFilters}
|
|
30
30
|
selectedFilters={selectedFilters}
|
|
31
31
|
>
|
|
32
|
-
{showMap && <FilterCommute className="hc-mt-6" />}
|
|
33
|
-
{showMap && (
|
|
32
|
+
{showMap && !noEntities && <FilterCommute className="hc-mt-6" />}
|
|
33
|
+
{showMap && !noEntities && (
|
|
34
34
|
<FilterPointsOfInterest
|
|
35
35
|
className="hc-mt-4"
|
|
36
36
|
pointsOfInterest={pointsOfInterest}
|
|
@@ -23,17 +23,17 @@ const ItemsListContainer: React.FC<ItemsListContainerProps> = ({
|
|
|
23
23
|
fieldsShown,
|
|
24
24
|
specialFeatures
|
|
25
25
|
}) => {
|
|
26
|
-
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites } = useMapList();
|
|
26
|
+
const { filteredListings, loading, commuteLocation, sortSetting, setSortSetting, ExpandListComponent, favorites, noEntities } = useMapList();
|
|
27
27
|
const { itemLimit, loader, scrollContainerRef, itemRefs } = useListLogic(filteredListings as any);
|
|
28
28
|
const { selectedListItem } = useMap();
|
|
29
29
|
const { trackEvent, eventTypes } = useTrackEvent() as any;
|
|
30
30
|
const itemExpandedContent = (item: any, recruiter: any) =>
|
|
31
31
|
item ? (ExpandListComponent ? <ExpandListComponent listing={item} /> : <ListingDetailsContainer item={item} recruiter={recruiter} />) : null;
|
|
32
32
|
|
|
33
|
-
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0) {
|
|
33
|
+
if (!fieldsShown.includes('travelTime') && commuteLocation != null && Object.entries(commuteLocation).length > 0 && !noEntities) {
|
|
34
34
|
fieldsShown.push('travelTime');
|
|
35
35
|
fieldNames['travelTime'] = 'Commute';
|
|
36
|
-
} else if (fieldsShown.includes('travelTime') && !commuteLocation) {
|
|
36
|
+
} else if (fieldsShown.includes('travelTime') && (!commuteLocation || noEntities)) {
|
|
37
37
|
fieldsShown = fieldsShown.filter(x => x !== 'travelTime');
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -57,7 +57,7 @@ const InfoWindowContentContainer = ({
|
|
|
57
57
|
newFilters.state = { [items[0].fields.state]: true };
|
|
58
58
|
filters.push({ filterType: 'state', filterChecked: items[0].fields.state });
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
newFilters.entityName = { [items[0].fields.entityName]: true };
|
|
62
62
|
filters.push({ filterType: 'entityName', filterChecked: items[0].fields.entityName });
|
|
63
63
|
|
|
@@ -256,9 +256,10 @@ const MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }
|
|
|
256
256
|
if (!mapItems) {
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
|
+
|
|
259
260
|
const mapItemsKey = mapItems.map(item => item.id).join("-");
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
|
|
262
263
|
return (
|
|
263
264
|
<Map
|
|
264
265
|
zoom={zoom}
|
|
@@ -31,19 +31,19 @@ const ButtonGroupApply = ({
|
|
|
31
31
|
|
|
32
32
|
const trackApplyNow = () => {
|
|
33
33
|
//console.log('calling trackApplyNow');
|
|
34
|
-
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobCategory: item.fields.
|
|
34
|
+
trackEvent(eventTypes.APPLY_NOW_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
35
35
|
};
|
|
36
36
|
const trackApplyOpen = () => {
|
|
37
37
|
//console.log('calling trackApplyOpen');
|
|
38
|
-
trackEvent(eventTypes.APPLY_OPEN_CLICKED, { jobCategory: item.fields.
|
|
38
|
+
trackEvent(eventTypes.APPLY_OPEN_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
39
39
|
};
|
|
40
40
|
const trackEasyApply = () => {
|
|
41
41
|
//console.log('calling trackEasyApply');
|
|
42
|
-
trackEvent(eventTypes.EASY_APPLY_CLICKED, { jobCategory: item.fields.
|
|
42
|
+
trackEvent(eventTypes.EASY_APPLY_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
43
43
|
};
|
|
44
44
|
const trackViewDetails = () => {
|
|
45
45
|
//console.log('calling trackViewDetails');
|
|
46
|
-
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobCategory: item.fields.
|
|
46
|
+
trackEvent(eventTypes.VIEW_DETAILS_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
return (
|
|
@@ -78,9 +78,9 @@ const ButtonGroupApply = ({
|
|
|
78
78
|
</Button.Anchor>
|
|
79
79
|
) : null}
|
|
80
80
|
|
|
81
|
-
{item.applyOnline ==
|
|
81
|
+
{item.fields.applyOnline == true && item.fields.applyUrl && !includeDialog &&
|
|
82
82
|
<Button.Anchor
|
|
83
|
-
href={item.applyUrl}
|
|
83
|
+
href={item.fields.applyUrl}
|
|
84
84
|
variant={applyButtonVariant}
|
|
85
85
|
size={buttonSize}
|
|
86
86
|
className={"map-apply-now-button"}
|
|
@@ -91,8 +91,8 @@ const ButtonGroupApply = ({
|
|
|
91
91
|
{applyNowText}
|
|
92
92
|
</Button.Anchor>
|
|
93
93
|
}
|
|
94
|
-
{item.applyOnline ==
|
|
95
|
-
<ApplyDialog applyUrl={item.applyUrl} internalApplyLink={internalApplyLink} companyName={companyName} item={item} trackEvent={trackEvent} eventTypes={eventTypes} isIframe={isIframe}>
|
|
94
|
+
{item.fields.applyOnline == true && item.fields.applyUrl && includeDialog &&
|
|
95
|
+
<ApplyDialog applyUrl={item.fields.applyUrl} internalApplyLink={internalApplyLink} companyName={companyName} item={item} trackEvent={trackEvent} eventTypes={eventTypes} isIframe={isIframe}>
|
|
96
96
|
<Button.Anchor
|
|
97
97
|
variant={applyButtonVariant}
|
|
98
98
|
size={buttonSize}
|
|
@@ -7,11 +7,11 @@ import Icon from '~/components/modules/icon';
|
|
|
7
7
|
const ApplyDialog = ({ children, applyUrl, internalApplyLink, companyName, item, trackEvent, eventTypes, isIframe }) => {
|
|
8
8
|
const trackApplyOption1 = () => {
|
|
9
9
|
//console.log('calling trackApplyOption1');
|
|
10
|
-
trackEvent(eventTypes.APPLY_OPTION_1_CLICKED, { jobCategory: item.fields.
|
|
10
|
+
trackEvent(eventTypes.APPLY_OPTION_1_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
11
11
|
};
|
|
12
12
|
const trackApplyOption2 = () => {
|
|
13
13
|
//console.log('calling trackApplyOption2');
|
|
14
|
-
trackEvent(eventTypes.APPLY_OPTION_2_CLICKED, { jobCategory: item.fields.
|
|
14
|
+
trackEvent(eventTypes.APPLY_OPTION_2_CLICKED, { jobCategory: item.fields.subCategory, jobCategoryClass: item.fields.category, jobEntity: item.fields.entityName, jobListingId: item.id, jobSchedule: item.fields.schedule });
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
return (
|
|
@@ -11,7 +11,7 @@ const FieldMapperDesktop = ({
|
|
|
11
11
|
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
12
12
|
|
|
13
13
|
const specialFeaturePills = field => {
|
|
14
|
-
return field === '
|
|
14
|
+
return field === 'title' && specialFeatures &&
|
|
15
15
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
16
16
|
return item.fields[featureKey] == 1 && (
|
|
17
17
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
@@ -29,7 +29,7 @@ const FieldMapperDesktop = ({
|
|
|
29
29
|
className={`
|
|
30
30
|
hc-hidden md:hc-block hc-px-2
|
|
31
31
|
${index === 0 ? "hc-pl-7" : ""}
|
|
32
|
-
${field.toLowerCase() === "
|
|
32
|
+
${field.toLowerCase() === "title" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
|
|
33
33
|
`}
|
|
34
34
|
>
|
|
35
35
|
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
@@ -12,7 +12,7 @@ const FieldMapperMobile = ({
|
|
|
12
12
|
includeFavorite = true
|
|
13
13
|
}) => {
|
|
14
14
|
const specialFeaturePills = field => {
|
|
15
|
-
return field === '
|
|
15
|
+
return field === 'title' && specialFeatures &&
|
|
16
16
|
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
17
17
|
return item.fields[featureKey] == 1 && (
|
|
18
18
|
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
@@ -22,11 +22,11 @@ const FieldMapperMobile = ({
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Grid.Item className="md:hc-hidden">
|
|
25
|
-
{fieldsShown.includes("
|
|
25
|
+
{fieldsShown.includes("title") &&
|
|
26
26
|
<>
|
|
27
27
|
<div className="hc-flex hc-items-start">
|
|
28
28
|
<div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]">
|
|
29
|
-
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.
|
|
29
|
+
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.title}</h3>
|
|
30
30
|
{includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
|
|
31
31
|
<Icon
|
|
32
32
|
icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
|
|
@@ -41,20 +41,20 @@ const FieldMapperMobile = ({
|
|
|
41
41
|
}
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
|
-
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("
|
|
44
|
+
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("title", true)} </div>}
|
|
45
45
|
</>
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
<ul className="hc-space-y-2 hc-text-xs">
|
|
49
49
|
{[
|
|
50
50
|
{
|
|
51
|
-
field: "
|
|
52
|
-
name: "
|
|
51
|
+
field: "category",
|
|
52
|
+
name: "category",
|
|
53
53
|
icon: "icon-park-solid:tree-list"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
field: "
|
|
57
|
-
name: "
|
|
56
|
+
field: "subCategory",
|
|
57
|
+
name: "subCategory",
|
|
58
58
|
icon: "icon-park-solid:tree-list"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -57,7 +57,7 @@ const HeaderItem = ({
|
|
|
57
57
|
size="none"
|
|
58
58
|
className={`
|
|
59
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() === "
|
|
60
|
+
${field.toLowerCase() === "title" ? "hc-pl-7 hc-col-span-4" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
|
|
61
61
|
${className ?? ""}
|
|
62
62
|
`}
|
|
63
63
|
{...rest}
|
|
@@ -8,7 +8,7 @@ const MapList = ({ showMap, loading, list, map, filter, mapPosition, containerSt
|
|
|
8
8
|
style={containerStyle}
|
|
9
9
|
className={`
|
|
10
10
|
${showMap === false ? "md:hc-grid-rows-[100%]" : "md:hc-grid-rows-[50%_50%]"}
|
|
11
|
-
hc-hidden md:hc-grid
|
|
11
|
+
hc-hidden md:hc-grid hc-overflow-hidden hc-relative bg-gray-100
|
|
12
12
|
`}
|
|
13
13
|
>
|
|
14
14
|
{mapPosition && mapPosition === 'top' && showMap ? (
|
|
@@ -37,37 +37,38 @@ interface MapProviderProps {
|
|
|
37
37
|
children: ReactNode;
|
|
38
38
|
resetFilters: boolean;
|
|
39
39
|
defaultZoomOverride?: number | null;
|
|
40
|
+
localStorageKey?: string;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
export const MapProvider: React.FC<MapProviderProps> = ({ children, resetFilters, defaultZoomOverride }) => {
|
|
43
|
-
const [selectedListItem, setSelectedListItem] = useState<Listing | null>(getStorageObject('selectedListItem'));
|
|
44
|
-
const [location, setLocation] = useState<any>(getStorageObject('location'));
|
|
45
|
-
const [center, setCenter] = useState<LatLng>(getStorageObject("center", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });
|
|
46
|
-
const [zoom, setZoom] = useState<number>(getStorageObject("zoom", 9) || 9);
|
|
43
|
+
export const MapProvider: React.FC<MapProviderProps> = ({ children, resetFilters, defaultZoomOverride, localStorageKey = '' }) => {
|
|
44
|
+
const [selectedListItem, setSelectedListItem] = useState<Listing | null>(getStorageObject(localStorageKey + 'selectedListItem'));
|
|
45
|
+
const [location, setLocation] = useState<any>(getStorageObject(localStorageKey + 'location'));
|
|
46
|
+
const [center, setCenter] = useState<LatLng>(getStorageObject(localStorageKey + "center", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });
|
|
47
|
+
const [zoom, setZoom] = useState<number>(getStorageObject(localStorageKey + "zoom", 9) || 9);
|
|
47
48
|
const [selectedPlaces, setSelectedPlaces] = useState<string[]>([]);
|
|
48
49
|
const [mapInteracted, setMapInteracted] = useState<boolean>(false);
|
|
49
|
-
const [firstLoadListItem] = useState<any>(getStorageObject('selectedListItem', { id: "defaultId" }));
|
|
50
|
+
const [firstLoadListItem] = useState<any>(getStorageObject(localStorageKey + 'selectedListItem', { id: "defaultId" }));
|
|
50
51
|
const userSetZoom = useRef<boolean>(true);
|
|
51
52
|
|
|
52
53
|
useEffect(() => {
|
|
53
|
-
setStorageObject("selectedListItem", selectedListItem);
|
|
54
|
-
}, [selectedListItem]);
|
|
54
|
+
setStorageObject(localStorageKey + "selectedListItem", selectedListItem);
|
|
55
|
+
}, [selectedListItem, localStorageKey]);
|
|
55
56
|
|
|
56
57
|
useEffect(() => {
|
|
57
|
-
localStorage.setItem("zoom", zoom.toString());
|
|
58
|
-
}, [zoom]);
|
|
58
|
+
localStorage.setItem(localStorageKey + "zoom", zoom.toString());
|
|
59
|
+
}, [zoom, localStorageKey]);
|
|
59
60
|
|
|
60
61
|
useEffect(() => {
|
|
61
62
|
if (location == null) {
|
|
62
|
-
localStorage.removeItem("location");
|
|
63
|
+
localStorage.removeItem(localStorageKey + "location");
|
|
63
64
|
} else {
|
|
64
|
-
setStorageObject("location", location);
|
|
65
|
+
setStorageObject(localStorageKey + "location", location);
|
|
65
66
|
}
|
|
66
|
-
}, [location]);
|
|
67
|
+
}, [location, localStorageKey]);
|
|
67
68
|
|
|
68
69
|
useEffect(() => {
|
|
69
|
-
setStorageObject("center", center);
|
|
70
|
-
}, [center]);
|
|
70
|
+
setStorageObject(localStorageKey + "center", center);
|
|
71
|
+
}, [center, localStorageKey]);
|
|
71
72
|
|
|
72
73
|
const selectItem = (item: Listing, itemLocation: LatLng | null, zoom: number, center: LatLng) => {
|
|
73
74
|
setSelectedListItem(item);
|
|
@@ -98,7 +99,7 @@ export const MapProvider: React.FC<MapProviderProps> = ({ children, resetFilters
|
|
|
98
99
|
}, [resetFilters]);
|
|
99
100
|
|
|
100
101
|
const selectLocationEntity = (location: LatLng) => {
|
|
101
|
-
localStorage.removeItem("selectedListItem");
|
|
102
|
+
localStorage.removeItem(localStorageKey + "selectedListItem");
|
|
102
103
|
setTimeout(() => setLocation(location), 200);
|
|
103
104
|
setSelectedListItem(null);
|
|
104
105
|
};
|