@abcagency/hc-ui-components 1.3.22 → 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.
- package/package.json +4 -1
- package/.env +0 -3
- package/.eslintrc +0 -136
- package/bundleDist/bundle.js +0 -28145
- package/bundleDist/bundle.js.map +0 -1
- package/bundleDist/dist/styles/index.css +0 -3
- package/bundleDist/dist/types/apis/hcApi.d.ts +0 -5
- package/bundleDist/dist/types/clientToken.d.ts +0 -2
- package/bundleDist/dist/types/components/containers/accordions/map-accordion-item-container.d.ts +0 -12
- package/bundleDist/dist/types/components/containers/jobListing/listing-details-container.d.ts +0 -6
- package/bundleDist/dist/types/components/containers/list/item-list-container.d.ts +0 -9
- package/bundleDist/dist/types/components/containers/list/list-item/list-item-container.d.ts +0 -14
- package/bundleDist/dist/types/components/modules/accordions/MapAccordionItem.d.ts +0 -10
- package/bundleDist/dist/types/components/modules/accordions/default.d.ts +0 -19
- package/bundleDist/dist/types/components/modules/buttons/button-group-apply.d.ts +0 -24
- package/bundleDist/dist/types/components/modules/buttons/commute-pill.d.ts +0 -5
- package/bundleDist/dist/types/components/modules/buttons/default.d.ts +0 -48
- package/bundleDist/dist/types/components/modules/buttons/pill-wrapper.d.ts +0 -3
- package/bundleDist/dist/types/components/modules/dialogs/apply-dialog.d.ts +0 -8
- package/bundleDist/dist/types/components/modules/filter/sort.d.ts +0 -8
- package/bundleDist/dist/types/components/modules/grid.d.ts +0 -8
- package/bundleDist/dist/types/components/modules/icon.d.ts +0 -10
- package/bundleDist/dist/types/components/modules/jobListing/listing-details.d.ts +0 -18
- package/bundleDist/dist/types/components/modules/list/field-mapper.d.ts +0 -10
- package/bundleDist/dist/types/components/modules/list/header-item.d.ts +0 -11
- package/bundleDist/dist/types/components/modules/list/header.d.ts +0 -11
- package/bundleDist/dist/types/components/modules/list/item-expand-card/index.d.ts +0 -7
- package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +0 -17
- package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +0 -21
- package/bundleDist/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +0 -8
- package/bundleDist/dist/types/components/modules/list/item-list.d.ts +0 -20
- package/bundleDist/dist/types/components/modules/list/list-item/list-item.d.ts +0 -3
- package/bundleDist/dist/types/constants/eventTypes.d.ts +0 -13
- package/bundleDist/dist/types/contexts/mapContext.d.ts +0 -29
- package/bundleDist/dist/types/contexts/mapListContext.d.ts +0 -59
- package/bundleDist/dist/types/contexts/trackEventContext.d.ts +0 -6
- package/bundleDist/dist/types/enums/SectionType.d.ts +0 -9
- package/bundleDist/dist/types/hooks/useList.d.ts +0 -13
- package/bundleDist/dist/types/services/configService.d.ts +0 -6
- package/bundleDist/dist/types/services/googlePlacesNearbyService.d.ts +0 -5
- package/bundleDist/dist/types/services/listingAggregatorService.d.ts +0 -12
- package/bundleDist/dist/types/services/listingEntityService.d.ts +0 -6
- package/bundleDist/dist/types/services/listingService.d.ts +0 -9
- package/bundleDist/dist/types/services/recruiterService.d.ts +0 -6
- package/bundleDist/dist/types/types/Address.d.ts +0 -7
- package/bundleDist/dist/types/types/ContentSection.d.ts +0 -8
- package/bundleDist/dist/types/types/GetListingParams.d.ts +0 -8
- package/bundleDist/dist/types/types/LatLng.d.ts +0 -4
- package/bundleDist/dist/types/types/ListingEntity.d.ts +0 -10
- package/bundleDist/dist/types/types/ListingFields.d.ts +0 -25
- package/bundleDist/dist/types/types/Listings.d.ts +0 -31
- package/bundleDist/dist/types/types/Recruiter.d.ts +0 -9
- package/bundleDist/dist/types/types/SimilarListing.d.ts +0 -24
- package/bundleDist/dist/types/types/config/Colors.d.ts +0 -8
- package/bundleDist/dist/types/types/config/MapConfig.d.ts +0 -30
- package/bundleDist/dist/types/types/config/PointsOfInterestConfig.d.ts +0 -13
- package/bundleDist/dist/types/types/config/SearchConfig.d.ts +0 -4
- package/bundleDist/dist/types/util/filterUtil.d.ts +0 -28
- package/bundleDist/dist/types/util/loading.d.ts +0 -3
- package/bundleDist/dist/types/util/localStorageUtil.d.ts +0 -3
- package/bundleDist/dist/types/util/mapUtil.d.ts +0 -15
- package/bundleDist/dist/types/util/sortUtil.d.ts +0 -1
- package/bundleDist/dist/types/util/stringUtils.d.ts +0 -1
- package/bundleDist/dist/types/util/urlFilterUtil.d.ts +0 -8
- package/bundleDist/styles/index.css +0 -3
- package/bundleDist.map +0 -1
- package/jsconfig.json +0 -7
- package/postcss.config.js +0 -14
- package/preset.default.js +0 -15
- package/rollup.config.mjs +0 -111
- package/src/.editorconfig +0 -12
- package/src/apis/hcApi.ts +0 -109
- package/src/bundleIndex.js +0 -14
- package/src/clientToken.js +0 -9
- package/src/components/HireControlMap.js +0 -135
- package/src/components/containers/accordions/filter-container.js +0 -48
- package/src/components/containers/accordions/filter-item-container.js +0 -66
- package/src/components/containers/accordions/map-accordion-item-container.js +0 -70
- package/src/components/containers/filter/commute-container.js +0 -89
- package/src/components/containers/filter/filter-container.js +0 -76
- package/src/components/containers/filter/filter-item-container.js +0 -71
- package/src/components/containers/filter/location-container.js +0 -45
- package/src/components/containers/filter/points-of-interest-container.js +0 -33
- package/src/components/containers/filter/points-of-interest-radio-item-container.js +0 -35
- package/src/components/containers/filter/search-container.js +0 -50
- package/src/components/containers/jobListing/listing-details-container.js +0 -40
- package/src/components/containers/list/item-list-container.tsx +0 -81
- package/src/components/containers/list/list-item/list-item-container.js +0 -43
- package/src/components/containers/maps/info-window-content-container.js +0 -51
- package/src/components/containers/maps/map-container.js +0 -204
- package/src/components/containers/maps/map-list-container.js +0 -48
- package/src/components/containers/maps/map-marker-container.js +0 -78
- package/src/components/modules/accordions/MapAccordionItem.js +0 -30
- package/src/components/modules/accordions/default.js +0 -171
- package/src/components/modules/accordions/filterItem.js +0 -27
- package/src/components/modules/accordions/filters.js +0 -32
- package/src/components/modules/buttons/button-group-apply.js +0 -123
- package/src/components/modules/buttons/commute-pill.js +0 -22
- package/src/components/modules/buttons/default.js +0 -194
- package/src/components/modules/buttons/items-pill.js +0 -35
- package/src/components/modules/buttons/pill-wrapper.js +0 -27
- package/src/components/modules/buttons/show-all-button.js +0 -20
- package/src/components/modules/cards/default.js +0 -167
- package/src/components/modules/cards/filter.js +0 -56
- package/src/components/modules/dialogs/apply-dialog.js +0 -48
- package/src/components/modules/filter/commute.js +0 -108
- package/src/components/modules/filter/index.js +0 -55
- package/src/components/modules/filter/item.js +0 -48
- package/src/components/modules/filter/location.js +0 -48
- package/src/components/modules/filter/radio-item.js +0 -42
- package/src/components/modules/filter/search.js +0 -65
- package/src/components/modules/filter/sort.js +0 -83
- package/src/components/modules/grid.js +0 -54
- package/src/components/modules/icon.js +0 -33
- package/src/components/modules/jobListing/listing-details.js +0 -109
- package/src/components/modules/list/field-mapper.js +0 -114
- package/src/components/modules/list/header-item.js +0 -91
- package/src/components/modules/list/header.js +0 -49
- package/src/components/modules/list/item-expand-card/index.js +0 -22
- package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +0 -50
- package/src/components/modules/list/item-expand-card/recruiter-details.js +0 -68
- package/src/components/modules/list/item-expand-card/recruiter-headshot.js +0 -22
- package/src/components/modules/list/item-list.tsx +0 -84
- package/src/components/modules/list/list-item/list-item.js +0 -130
- package/src/components/modules/maps/info-window-card.js +0 -17
- package/src/components/modules/maps/info-window-content.js +0 -35
- package/src/components/modules/maps/map-list.js +0 -28
- package/src/components/modules/maps/map-marker.js +0 -29
- package/src/components/modules/maps/map.js +0 -76
- package/src/components/modules/maps/place-marker.js +0 -41
- package/src/components/modules/maps/tabs.js +0 -81
- package/src/constants/eventTypes.js +0 -13
- package/src/constants/placeTypes.js +0 -8
- package/src/contexts/mapContext.tsx +0 -129
- package/src/contexts/mapListContext.tsx +0 -311
- package/src/contexts/placesContext.js +0 -102
- package/src/contexts/trackEventContext.js +0 -14
- package/src/enums/SectionType.ts +0 -9
- package/src/hooks/useList.js +0 -89
- package/src/index.js +0 -3
- package/src/services/configService.ts +0 -16
- package/src/services/googlePlacesNearbyService.ts +0 -42
- package/src/services/listingAggregatorService.ts +0 -76
- package/src/services/listingEntityService.ts +0 -16
- package/src/services/listingService.ts +0 -40
- package/src/services/recruiterService.ts +0 -18
- package/src/styles/bundle.css +0 -268
- package/src/styles/index.css +0 -24
- package/src/types/Address.ts +0 -7
- package/src/types/ContentSection.ts +0 -9
- package/src/types/GetListingParams.ts +0 -8
- package/src/types/LatLng.ts +0 -4
- package/src/types/ListingEntity.ts +0 -11
- package/src/types/ListingFields.ts +0 -25
- package/src/types/Listings.ts +0 -32
- package/src/types/Recruiter.ts +0 -9
- package/src/types/SimilarListing.ts +0 -24
- package/src/types/config/Colors.ts +0 -8
- package/src/types/config/MapConfig.ts +0 -31
- package/src/types/config/PointsOfInterestConfig.ts +0 -13
- package/src/types/config/SearchConfig.ts +0 -4
- package/src/util/arrayUtil.js +0 -3
- package/src/util/fieldMapper.js +0 -22
- package/src/util/filterUtil.js +0 -239
- package/src/util/loading.js +0 -17
- package/src/util/localStorageUtil.ts +0 -34
- package/src/util/mapIconUtil.js +0 -180
- package/src/util/mapUtil.js +0 -91
- package/src/util/sortUtil.js +0 -33
- package/src/util/stringUtils.js +0 -6
- package/src/util/urlFilterUtil.js +0 -85
- package/stats.html +0 -4842
- package/tailwind.config.js +0 -129
- package/tsconfig.json +0 -23
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import React, { useEffect, useRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import MapMarker from "~/components/containers/maps/map-marker-container";
|
|
5
|
-
import PlaceMarker from "~/components/modules/maps/place-marker";
|
|
6
|
-
|
|
7
|
-
import { usePlaces } from "~/contexts/placesContext";
|
|
8
|
-
import { useMap } from "~/contexts/mapContext";
|
|
9
|
-
import { useMapList } from "~/contexts/mapListContext";
|
|
10
|
-
|
|
11
|
-
import { markerIconSelected, markerIcon, pinIcon } from "~/util/mapIconUtil";
|
|
12
|
-
|
|
13
|
-
import Map from "~/components/modules/maps/map";
|
|
14
|
-
|
|
15
|
-
const MapContainer = ({
|
|
16
|
-
markerConfigs,
|
|
17
|
-
infoWindowClasses,
|
|
18
|
-
clusterGridSize = 60
|
|
19
|
-
}) => {
|
|
20
|
-
const {
|
|
21
|
-
location,
|
|
22
|
-
zoom,
|
|
23
|
-
center,
|
|
24
|
-
commuteLocation,
|
|
25
|
-
selectLocationEntity,
|
|
26
|
-
setLocation,
|
|
27
|
-
mapInteracted,
|
|
28
|
-
setMapInteracted
|
|
29
|
-
} = useMap();
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
mapItems, filteredListings, setSelectedFilters,
|
|
33
|
-
setQuery
|
|
34
|
-
} = useMapList();
|
|
35
|
-
|
|
36
|
-
const mapRef = useRef();
|
|
37
|
-
const markerRefs = useRef({});
|
|
38
|
-
const mapContainerRef = useRef(null);
|
|
39
|
-
const {
|
|
40
|
-
poiMarkers,
|
|
41
|
-
setCurrentCenter,
|
|
42
|
-
currentCenter,
|
|
43
|
-
setCurrentZoom,
|
|
44
|
-
currentZoom,
|
|
45
|
-
selectedPlaceMarker,
|
|
46
|
-
setSelectedPlaceMarker,
|
|
47
|
-
placesWindow,
|
|
48
|
-
setPlacesWindow } = usePlaces();
|
|
49
|
-
|
|
50
|
-
const onIdle = () => {
|
|
51
|
-
if (!currentCenter || !mapRef.current) return;
|
|
52
|
-
const newCenter = mapRef.current.getCenter().toJSON();
|
|
53
|
-
const newZoom = mapRef.current.zoom;
|
|
54
|
-
|
|
55
|
-
setCurrentCenter(newCenter);
|
|
56
|
-
|
|
57
|
-
if (newZoom !== currentZoom) {
|
|
58
|
-
setCurrentZoom(newZoom);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (mapContainerRef.current) {
|
|
64
|
-
const handleScroll = () => {
|
|
65
|
-
setMapInteracted(true);
|
|
66
|
-
};
|
|
67
|
-
var mapContainerRefCurrent = mapContainerRef.current;
|
|
68
|
-
mapContainerRef.current.addEventListener('wheel', handleScroll);
|
|
69
|
-
return () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);
|
|
70
|
-
}
|
|
71
|
-
}, [mapContainerRef.current]);
|
|
72
|
-
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (mapRef.current) {
|
|
75
|
-
const mapInstance = mapRef.current;
|
|
76
|
-
const dragStartListener = mapInstance.addListener('dragstart', () => setMapInteracted(true));
|
|
77
|
-
const mouseDownListener = mapInstance.addListener('mousedown', () => setMapInteracted(true));
|
|
78
|
-
return () => {
|
|
79
|
-
google.maps.event.removeListener(dragStartListener);
|
|
80
|
-
google.maps.event.removeListener(mouseDownListener);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}, [mapRef.current, mapContainerRef.current]);
|
|
84
|
-
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {
|
|
87
|
-
fitBounds(mapRef.current);
|
|
88
|
-
}
|
|
89
|
-
}, [mapItems, mapRef.current, location]);
|
|
90
|
-
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current && mapInteracted) {
|
|
93
|
-
fitBounds(mapRef.current, true);
|
|
94
|
-
}
|
|
95
|
-
if (mapRef.current) {
|
|
96
|
-
let currZoom = mapRef.current.zoom;
|
|
97
|
-
let setZoomVal = currZoom < 13 ? currZoom : 12;
|
|
98
|
-
mapRef.current.setZoom(setZoomVal);
|
|
99
|
-
}
|
|
100
|
-
}, [filteredListings]);
|
|
101
|
-
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (!mapRef.current || !location || mapInteracted) return;
|
|
104
|
-
mapRef.current.panTo(
|
|
105
|
-
new google.maps.LatLng(location.latitude, location.longitude)
|
|
106
|
-
);
|
|
107
|
-
if (mapRef.current) {
|
|
108
|
-
let setZoomVal = zoom < 13 ? zoom : 12;
|
|
109
|
-
mapRef.current.setZoom(setZoomVal);
|
|
110
|
-
}
|
|
111
|
-
}, [location, zoom, mapRef.current]);
|
|
112
|
-
|
|
113
|
-
const fitBounds = (map, overload = false) => {
|
|
114
|
-
if ((mapInteracted === false || overload) && mapItems != null) {
|
|
115
|
-
const bounds = new window.google.maps.LatLngBounds();
|
|
116
|
-
mapItems.forEach(item => {
|
|
117
|
-
bounds.extend(new google.maps.LatLng(item.latitude, item.longitude));
|
|
118
|
-
});
|
|
119
|
-
if (!map) return;
|
|
120
|
-
map.fitBounds(bounds);
|
|
121
|
-
}
|
|
122
|
-
if (mapRef.current.zoom > 17) {
|
|
123
|
-
mapRef.current.setZoom(16);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const markerClickHandler = mapLocation => {
|
|
128
|
-
setMapInteracted(true);
|
|
129
|
-
selectLocationEntity(mapLocation);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const onLoad = map => {
|
|
133
|
-
if (!location || location === null) {
|
|
134
|
-
mapRef.current = map;
|
|
135
|
-
fitBounds(map, true);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
mapRef.current = map;
|
|
139
|
-
|
|
140
|
-
if (mapInteracted === false) {
|
|
141
|
-
mapRef.current.panTo(
|
|
142
|
-
new google.maps.LatLng(location.latitude, location.longitude)
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
mapRef.current.setZoom(zoom);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
const pinIconUrl = pinIcon({
|
|
150
|
-
fillColor: markerConfigs.fillColor,
|
|
151
|
-
strokeColor: markerConfigs.strokeColor
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
const mapMarkers = mapItems.map(item => (
|
|
155
|
-
<MapMarker
|
|
156
|
-
key={item.id}
|
|
157
|
-
item={item}
|
|
158
|
-
selectedLocation={location}
|
|
159
|
-
markerRefs={markerRefs}
|
|
160
|
-
infoWindowClasses={infoWindowClasses}
|
|
161
|
-
setSelectedLocation={setLocation}
|
|
162
|
-
markerClickHandler={markerClickHandler}
|
|
163
|
-
markerIcon={markerIcon(markerConfigs)}
|
|
164
|
-
markerIconSelected={markerIconSelected(markerConfigs)}
|
|
165
|
-
setMapInteracted={setMapInteracted}
|
|
166
|
-
/>
|
|
167
|
-
));
|
|
168
|
-
|
|
169
|
-
const placeMarkers = poiMarkers.markers.map((marker, index) => (
|
|
170
|
-
<PlaceMarker
|
|
171
|
-
key={`marker-${marker.title}-${index}`}
|
|
172
|
-
marker={marker}
|
|
173
|
-
index={index}
|
|
174
|
-
selectedPlaceMarker={selectedPlaceMarker}
|
|
175
|
-
placesWindow={placesWindow}
|
|
176
|
-
setPlacesWindow={setPlacesWindow}
|
|
177
|
-
setSelectedPlaceMarker={setSelectedPlaceMarker}
|
|
178
|
-
/>
|
|
179
|
-
));
|
|
180
|
-
|
|
181
|
-
return (
|
|
182
|
-
<Map
|
|
183
|
-
zoom={zoom}
|
|
184
|
-
center={center}
|
|
185
|
-
mapContainerRef={mapContainerRef}
|
|
186
|
-
onLoad={onLoad}
|
|
187
|
-
onIdle={onIdle}
|
|
188
|
-
clusterGridSize={clusterGridSize}
|
|
189
|
-
markerConfigs={markerConfigs}
|
|
190
|
-
mapMarkers={mapMarkers}
|
|
191
|
-
placeMarkers={placeMarkers}
|
|
192
|
-
mapInteracted={mapInteracted}
|
|
193
|
-
pinIconUrl={pinIconUrl}
|
|
194
|
-
setMapInteracted={setMapInteracted}
|
|
195
|
-
fitBounds={fitBounds}
|
|
196
|
-
mapRef={mapRef}
|
|
197
|
-
setQuery={setQuery}
|
|
198
|
-
filteredListingsLength={filteredListings.length}
|
|
199
|
-
setSelectedFilters={setSelectedFilters}
|
|
200
|
-
/>
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
export default MapContainer;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import List from '~/components/containers/list/item-list-container';
|
|
4
|
-
import Map from '~/components/containers/maps/map-container';
|
|
5
|
-
import Filter from '~/components/modules/filter';
|
|
6
|
-
import MapList from '~/components/modules/maps/map-list';
|
|
7
|
-
|
|
8
|
-
const MapListContainer = ({
|
|
9
|
-
loading = false,
|
|
10
|
-
mapDetails,
|
|
11
|
-
markerConfigs,
|
|
12
|
-
itemExpandedContent,
|
|
13
|
-
fieldsShown,
|
|
14
|
-
specialFeatures,
|
|
15
|
-
fieldNames,
|
|
16
|
-
showMap,
|
|
17
|
-
placeMappings
|
|
18
|
-
}) => {
|
|
19
|
-
|
|
20
|
-
const listProps = {
|
|
21
|
-
fieldsShown,
|
|
22
|
-
fieldNames,
|
|
23
|
-
itemExpandedContent,
|
|
24
|
-
loading,
|
|
25
|
-
showMap,
|
|
26
|
-
specialFeatures
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const mapProps = {
|
|
30
|
-
mapDetails,
|
|
31
|
-
markerConfigs,
|
|
32
|
-
placeMappings,
|
|
33
|
-
clusterGridSize: 60,
|
|
34
|
-
showMap
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<MapList
|
|
39
|
-
showMap={showMap}
|
|
40
|
-
loading={loading}
|
|
41
|
-
list={<List {...listProps} />}
|
|
42
|
-
map={<Map {...mapProps} />}
|
|
43
|
-
filter={<Filter showMap={showMap} className="md:hc-hidden" />}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default MapListContainer;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import MapMarker from '~/components/modules/maps/map-marker';
|
|
3
|
-
import { InfoWindow } from '@react-google-maps/api';
|
|
4
|
-
import InfoWindowCard from '~/components/modules/maps/info-window-card';
|
|
5
|
-
import InfoWindowContent from "~/components/containers/maps/info-window-content-container";
|
|
6
|
-
|
|
7
|
-
import { useMap } from "~/contexts/mapContext";
|
|
8
|
-
import { useMapList } from "~/contexts/mapListContext";
|
|
9
|
-
import { useTrackEvent } from '~/contexts/trackEventContext';
|
|
10
|
-
|
|
11
|
-
const MapMarkerContainer = ({
|
|
12
|
-
item,
|
|
13
|
-
markerRefs,
|
|
14
|
-
infoWindowClasses,
|
|
15
|
-
markerClickHandler,
|
|
16
|
-
clusterer,
|
|
17
|
-
markerIconSelected,
|
|
18
|
-
markerIcon,
|
|
19
|
-
selectedLocation,
|
|
20
|
-
setMapInteracted
|
|
21
|
-
}) => {
|
|
22
|
-
const { setLocation, commuteLocation } = useMap();
|
|
23
|
-
const isSelected = item.id === selectedLocation?.id;
|
|
24
|
-
const markerRef = useRef(null);
|
|
25
|
-
const { trackEvent, eventTypes } = useTrackEvent();
|
|
26
|
-
const { handleFilterListingsByLocation } = useMapList();
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
markerRefs.current[item.id] = markerRef.current;
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
const onMarkerClick = () => {
|
|
33
|
-
trackEvent(eventTypes.MAP_MARKER_CLICKED, {
|
|
34
|
-
entityDisplayName: item.entityDisplayName,
|
|
35
|
-
lat: item.latitude,
|
|
36
|
-
lng: item.longitude,
|
|
37
|
-
travelTime: item.travelTime
|
|
38
|
-
});
|
|
39
|
-
setMapInteracted(true);
|
|
40
|
-
markerClickHandler(item);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<MapMarker
|
|
45
|
-
position={{ lat: item.latitude, lng: item.longitude }}
|
|
46
|
-
title={item.name}
|
|
47
|
-
icon={isSelected ? markerIconSelected : markerIcon}
|
|
48
|
-
zIndex={isSelected ? 9999 : 1}
|
|
49
|
-
onLoad={marker => (markerRef.current = marker)}
|
|
50
|
-
onClick={onMarkerClick}
|
|
51
|
-
clusterer={clusterer}
|
|
52
|
-
>
|
|
53
|
-
{isSelected && (
|
|
54
|
-
<InfoWindow
|
|
55
|
-
position={{ lat: item.latitude, lng: item.longitude }}
|
|
56
|
-
anchor={markerRefs.current[item.id]}
|
|
57
|
-
onCloseClick={() => {
|
|
58
|
-
setMapInteracted(true);
|
|
59
|
-
setLocation(null);
|
|
60
|
-
}}
|
|
61
|
-
options={{ maxWidth: 400 }}
|
|
62
|
-
>
|
|
63
|
-
<InfoWindowCard
|
|
64
|
-
className={infoWindowClasses}
|
|
65
|
-
id={item.id}
|
|
66
|
-
content={<InfoWindowContent
|
|
67
|
-
item={item}
|
|
68
|
-
commuteLocation={commuteLocation}
|
|
69
|
-
filterListingsByLocation={() => handleFilterListingsByLocation(selectedLocation)}
|
|
70
|
-
/>}
|
|
71
|
-
/>
|
|
72
|
-
</InfoWindow>
|
|
73
|
-
)}
|
|
74
|
-
</MapMarker>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default MapMarkerContainer;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Accordion from '~/components/modules/accordions/default';
|
|
3
|
-
import ItemExpandCard from '~/components/modules/list/item-expand-card';
|
|
4
|
-
|
|
5
|
-
const MapAccordionItem = ({
|
|
6
|
-
item,
|
|
7
|
-
itemRefs,
|
|
8
|
-
itemExpandedContent,
|
|
9
|
-
isActive,
|
|
10
|
-
recruiter,
|
|
11
|
-
children
|
|
12
|
-
}) => {
|
|
13
|
-
return (
|
|
14
|
-
<Accordion.Item key={item.id} id={item.id}>
|
|
15
|
-
<Accordion.Trigger.Blank>
|
|
16
|
-
<div ref={el => (itemRefs.current[item.id] = el)}>
|
|
17
|
-
{children}
|
|
18
|
-
</div>
|
|
19
|
-
</Accordion.Trigger.Blank>
|
|
20
|
-
{isActive &&
|
|
21
|
-
|
|
22
|
-
<Accordion.Content bodyClassName="hc-px-2 hc-py-2 hc-pt-0 hc-bg-uiAccent/5 hc-border-secondary hc-border hc-border-t-0">
|
|
23
|
-
{ <ItemExpandCard content={itemExpandedContent(item, recruiter)} />}
|
|
24
|
-
</Accordion.Content>
|
|
25
|
-
}
|
|
26
|
-
</Accordion.Item>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default MapAccordionItem;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import * as RadixAccordion from '@radix-ui/react-accordion';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
|
|
5
|
-
import Icon from '~/components/modules/icon';
|
|
6
|
-
|
|
7
|
-
const Accordion = ({
|
|
8
|
-
className,
|
|
9
|
-
type = 'single',
|
|
10
|
-
defaultValue,
|
|
11
|
-
collapsible = true,
|
|
12
|
-
children
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<RadixAccordion.Root
|
|
16
|
-
type={type}
|
|
17
|
-
value={defaultValue ?? null}
|
|
18
|
-
collapsible={collapsible}
|
|
19
|
-
className={className ?? ''}
|
|
20
|
-
>
|
|
21
|
-
{children}
|
|
22
|
-
</RadixAccordion.Root>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const AccordionItem = forwardRef((
|
|
27
|
-
{
|
|
28
|
-
id,
|
|
29
|
-
children,
|
|
30
|
-
className,
|
|
31
|
-
...props
|
|
32
|
-
},
|
|
33
|
-
forwardedRef
|
|
34
|
-
) => {
|
|
35
|
-
return (
|
|
36
|
-
<RadixAccordion.Item
|
|
37
|
-
ref={forwardedRef}
|
|
38
|
-
value={id}
|
|
39
|
-
className={className ?? ''}
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
{children}
|
|
43
|
-
</RadixAccordion.Item>
|
|
44
|
-
);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export const AccordionTrigger = forwardRef((
|
|
48
|
-
{
|
|
49
|
-
children,
|
|
50
|
-
className,
|
|
51
|
-
...props
|
|
52
|
-
},
|
|
53
|
-
forwardedRef
|
|
54
|
-
) => (
|
|
55
|
-
<RadixAccordion.Header asChild>
|
|
56
|
-
<RadixAccordion.Trigger
|
|
57
|
-
ref={forwardedRef}
|
|
58
|
-
className={twMerge(
|
|
59
|
-
'hc-group hc-flex hc-justify-between hc-w-full hc-p-4 hc-font-bold hc-text-left hc-text-uiText focus:hc-outline-none hfocus-visible:hcring focus-visible:hc-ring-uiAccent focus-visible:hc-ring-opacity-75 hover:hc-text-primary focus:hc-text-primary hc-transition data-[state=open]:hc-text-primary',
|
|
60
|
-
className ?? ''
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
<Icon
|
|
66
|
-
icon="uil:angle-down"
|
|
67
|
-
size="hc-size-5"
|
|
68
|
-
className="hc-transition-transform group-data-[state=open]:!hc-rotate-180"
|
|
69
|
-
aria-hidden="true"
|
|
70
|
-
/>
|
|
71
|
-
</RadixAccordion.Trigger>
|
|
72
|
-
</RadixAccordion.Header>
|
|
73
|
-
));
|
|
74
|
-
|
|
75
|
-
export const AccordionTriggerHasHeader = forwardRef((
|
|
76
|
-
{
|
|
77
|
-
header,
|
|
78
|
-
headerClassName,
|
|
79
|
-
iconClassName,
|
|
80
|
-
children,
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
},
|
|
84
|
-
forwardedRef
|
|
85
|
-
) => (
|
|
86
|
-
<RadixAccordion.Header
|
|
87
|
-
className={twMerge(
|
|
88
|
-
'hc-group hc-flex hc-items-start hc-justify-between hc-w-full hc-p-4 hc-pr-3 hc-font-bold hc-text-left hc-text-uiText focus:hc-outline-none focus-visible:hc-ring focus-visible:hc-ring-uiAccent focus-visible:hc-ring-opacity-75 hover:hc-text-primary focus:hc-text-primary hc-transition data-[state=open]:hc-text-primary',
|
|
89
|
-
headerClassName ?? ''
|
|
90
|
-
)}
|
|
91
|
-
>
|
|
92
|
-
<RadixAccordion.Trigger
|
|
93
|
-
ref={forwardedRef}
|
|
94
|
-
className={twMerge('hc-flex hc-items-center hc-justify-between hc-w-full', className ?? '')}
|
|
95
|
-
{...props}
|
|
96
|
-
>
|
|
97
|
-
{children}
|
|
98
|
-
<Icon
|
|
99
|
-
icon="uil:angle-down"
|
|
100
|
-
size="w-5 h-5"
|
|
101
|
-
className={twMerge(
|
|
102
|
-
'hc-transition-transform group-data-[state=open]:!hc-rotate-180',
|
|
103
|
-
iconClassName ?? ''
|
|
104
|
-
)}
|
|
105
|
-
aria-hidden="true"
|
|
106
|
-
/>
|
|
107
|
-
{header}
|
|
108
|
-
</RadixAccordion.Trigger>
|
|
109
|
-
</RadixAccordion.Header>
|
|
110
|
-
));
|
|
111
|
-
|
|
112
|
-
export const AccordionTriggerBlank = forwardRef((
|
|
113
|
-
{
|
|
114
|
-
children,
|
|
115
|
-
className,
|
|
116
|
-
...props
|
|
117
|
-
},
|
|
118
|
-
forwardedRef
|
|
119
|
-
) => (
|
|
120
|
-
<RadixAccordion.Header asChild>
|
|
121
|
-
<RadixAccordion.Trigger
|
|
122
|
-
asChild
|
|
123
|
-
ref={forwardedRef}
|
|
124
|
-
{...props}
|
|
125
|
-
>
|
|
126
|
-
{children}
|
|
127
|
-
</RadixAccordion.Trigger>
|
|
128
|
-
</RadixAccordion.Header>
|
|
129
|
-
));
|
|
130
|
-
|
|
131
|
-
export const AccordionContent = forwardRef((
|
|
132
|
-
{
|
|
133
|
-
children,
|
|
134
|
-
className,
|
|
135
|
-
bodyClassName,
|
|
136
|
-
...props
|
|
137
|
-
},
|
|
138
|
-
forwardedRef
|
|
139
|
-
) => (
|
|
140
|
-
<RadixAccordion.Content
|
|
141
|
-
ref={forwardedRef}
|
|
142
|
-
className={twMerge(
|
|
143
|
-
'data-[state=open]:hc-animate-slideDown data-[state=closed]:hc-animate-slideUp hc-overflow-hidden',
|
|
144
|
-
className ?? ''
|
|
145
|
-
)}
|
|
146
|
-
{...props}
|
|
147
|
-
>
|
|
148
|
-
<div
|
|
149
|
-
className={twMerge(
|
|
150
|
-
'hc-p-4 hc-pt-0.5',
|
|
151
|
-
bodyClassName ?? ''
|
|
152
|
-
)}
|
|
153
|
-
>
|
|
154
|
-
{children}
|
|
155
|
-
</div>
|
|
156
|
-
</RadixAccordion.Content>
|
|
157
|
-
));
|
|
158
|
-
|
|
159
|
-
Accordion.Item = AccordionItem;
|
|
160
|
-
Accordion.Trigger = AccordionTrigger;
|
|
161
|
-
Accordion.Trigger.Blank = AccordionTriggerBlank;
|
|
162
|
-
Accordion.Trigger.HasHeader = AccordionTriggerHasHeader;
|
|
163
|
-
Accordion.Content = AccordionContent;
|
|
164
|
-
|
|
165
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
166
|
-
AccordionTrigger.displayName = 'AccordionTrigger';
|
|
167
|
-
AccordionTriggerBlank.displayName = 'AccordionTriggerBlank';
|
|
168
|
-
AccordionTriggerHasHeader.displayName = 'AccordionTriggerHasHeader';
|
|
169
|
-
AccordionContent.displayName = 'AccordionContent';
|
|
170
|
-
|
|
171
|
-
export default Accordion;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Accordion from '~/components/modules/accordions/default';
|
|
3
|
-
|
|
4
|
-
const AccordionFilterItem = ({
|
|
5
|
-
id,
|
|
6
|
-
setDefaultValue,
|
|
7
|
-
header,
|
|
8
|
-
body
|
|
9
|
-
}) => {
|
|
10
|
-
return (
|
|
11
|
-
<Accordion.Item key={id} id={id}>
|
|
12
|
-
<Accordion.Trigger.HasHeader
|
|
13
|
-
onClick={() => setDefaultValue(id)}
|
|
14
|
-
className="hc-stretched-link hc-text-left"
|
|
15
|
-
iconClassName="hc-order-last"
|
|
16
|
-
headerClassName="hc-relative hc-py-2 hc-rounded hc-border hc-border-uiAccent/20 hc-bg-white hc-text-sm hc-transition data-[state=open]:hc-border-b-transparent data-[state=open]:hc-rounded-b-none"
|
|
17
|
-
>
|
|
18
|
-
{header}
|
|
19
|
-
</Accordion.Trigger.HasHeader>
|
|
20
|
-
<Accordion.Content bodyClassName="hc-px-2 hc-py-1 hc-bg-white hc-rounded-b hc-border hc-border-uiAccent/20 hc-border-t-0 hc-max-h-[20vh] md:hc-max-h-[25vh] hc-overflow-auto">
|
|
21
|
-
{body}
|
|
22
|
-
</Accordion.Content>
|
|
23
|
-
</Accordion.Item>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default AccordionFilterItem;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Accordion from '~/components/modules/accordions/default';
|
|
3
|
-
import FilterCard from '~/components/modules/cards/filter';
|
|
4
|
-
import Loading from '~/util/loading';
|
|
5
|
-
|
|
6
|
-
const AccordionFilters = ({
|
|
7
|
-
className,
|
|
8
|
-
defaultValue,
|
|
9
|
-
children,
|
|
10
|
-
filterOptions
|
|
11
|
-
}) => {
|
|
12
|
-
return (
|
|
13
|
-
<FilterCard className={className ?? ""}>
|
|
14
|
-
<FilterCard.Title icon="fa-solid:sliders-h">
|
|
15
|
-
<span>
|
|
16
|
-
Filter <span className="md:hc-hidden lg:hc-inline">your search</span>
|
|
17
|
-
</span>
|
|
18
|
-
</FilterCard.Title>
|
|
19
|
-
|
|
20
|
-
<Accordion defaultValue={defaultValue} className="hc-space-y-4" >
|
|
21
|
-
{!filterOptions?.filters && (
|
|
22
|
-
<Accordion.Item>
|
|
23
|
-
<Loading />
|
|
24
|
-
</Accordion.Item>
|
|
25
|
-
)}
|
|
26
|
-
{filterOptions?.filters && children}
|
|
27
|
-
</Accordion>
|
|
28
|
-
</FilterCard>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default AccordionFilters;
|