@abcagency/hc-ui-components 1.3.58 → 1.3.60
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 +11 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/commute-container.js +1 -1
- package/dist/components/containers/filter/commute-container.js.map +1 -1
- package/dist/components/containers/filter/filter-container.js.map +1 -1
- package/dist/components/containers/filter/filter-item-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js.map +1 -1
- 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.map +1 -1
- package/dist/components/containers/filter/search-container.js.map +1 -1
- package/dist/components/containers/jobListing/listing-details-container.js +5 -1
- package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
- package/dist/components/containers/list/item-list-container.js.map +1 -1
- package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +1 -1
- package/dist/components/containers/maps/map-list-container.js.map +1 -1
- package/dist/components/containers/maps/map-marker-container.js +1 -1
- package/dist/components/containers/maps/map-marker-container.js.map +1 -1
- package/dist/components/modules/accordions/default.js +2 -2
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +48 -54
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/default.js +2 -2
- package/dist/components/modules/cards/default.js +2 -2
- package/dist/components/modules/dialogs/apply-dialog.js +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +2 -2
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js +2 -2
- package/dist/components/modules/grid.js +1 -1
- package/dist/components/modules/icon.js +1 -1
- package/dist/components/modules/jobListing/listing-details.js +8 -7
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/list/field-mapper.js.map +1 -1
- package/dist/components/modules/list/header-item.js.map +1 -1
- package/dist/components/modules/list/header.js +1 -1
- package/dist/components/modules/list/item-expand-card/index.js +1 -1
- package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js +38 -38
- package/dist/components/modules/list/item-expand-card/recruiter-details.js +40 -40
- package/dist/components/modules/list/item-expand-card/recruiter-headshot.js +20 -20
- package/dist/components/modules/list/item-list.js +3 -3
- package/dist/components/modules/list/item-list.js.map +1 -1
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +1 -1
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js +1 -1
- package/dist/components/modules/maps/place-marker.js +1 -1
- package/dist/components/modules/maps/tabs.js +1 -1
- package/dist/constants/eventTypes.js +1 -0
- package/dist/constants/eventTypes.js.map +1 -1
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +3 -1
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/contexts/themeContext.js.map +1 -1
- package/dist/services/configService.js.map +1 -1
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js.map +1 -1
- package/dist/services/recruiterService.js.map +1 -1
- package/dist/types/components/modules/buttons/button-group-apply.d.ts +4 -4
- package/dist/types/components/modules/jobListing/listing-details.d.ts +3 -1
- package/dist/types/constants/eventTypes.d.ts +1 -0
- package/dist/types/contexts/mapListContext.d.ts +4 -0
- package/dist/util/filterUtil.js +3 -3
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/dist/util/mapUtil.js.map +1 -1
- package/package.json +90 -90
- package/src/.editorconfig +12 -12
- package/src/bundleIndex.js +14 -14
- package/src/components/HireControlMap.js +148 -142
- package/src/components/containers/accordions/filter-item-container.js +83 -83
- package/src/components/containers/filter/commute-container.js +89 -89
- package/src/components/containers/filter/filter-container.js +76 -76
- package/src/components/containers/filter/filter-item-container.js +117 -117
- package/src/components/containers/filter/location-container.js +45 -45
- package/src/components/containers/filter/points-of-interest-container.js +33 -33
- package/src/components/containers/filter/points-of-interest-radio-item-container.js +35 -35
- package/src/components/containers/filter/search-container.js +61 -61
- package/src/components/containers/jobListing/listing-details-container.js +3 -1
- package/src/components/containers/list/item-list-container.tsx +81 -81
- package/src/components/containers/maps/info-window-content-container.js +53 -53
- package/src/components/containers/maps/map-list-container.js +50 -50
- package/src/components/containers/maps/map-marker-container.js +78 -78
- package/src/components/modules/accordions/filterItem.js +27 -27
- package/src/components/modules/accordions/filters.js +32 -32
- package/src/components/modules/buttons/button-group-apply.js +115 -135
- package/src/components/modules/dialogs/apply-dialog.js +48 -48
- package/src/components/modules/filter/commute.js +108 -108
- package/src/components/modules/filter/index.js +55 -55
- package/src/components/modules/filter/location.js +51 -51
- package/src/components/modules/filter/radio-item.js +42 -42
- package/src/components/modules/filter/search.js +79 -79
- package/src/components/modules/jobListing/listing-details.js +110 -108
- package/src/components/modules/list/field-mapper.js +130 -130
- package/src/components/modules/list/header-item.js +92 -92
- package/src/components/modules/list/item-expand-card/index.js +22 -22
- package/src/components/modules/list/item-list.tsx +117 -117
- package/src/components/modules/list/list-item/list-item.js +130 -130
- package/src/components/modules/maps/info-window-content.js +64 -64
- package/src/components/modules/maps/map-list.js +38 -38
- package/src/components/modules/maps/map-marker.js +29 -29
- package/src/constants/eventTypes.js +15 -14
- package/src/contexts/mapContext.tsx +129 -129
- package/src/contexts/mapListContext.tsx +326 -318
- package/src/contexts/placesContext.js +102 -102
- package/src/contexts/themeContext.js +40 -40
- package/src/services/configService.ts +16 -16
- package/src/services/listingEntityService.ts +16 -16
- package/src/services/listingService.ts +40 -40
- package/src/services/recruiterService.ts +18 -18
- package/src/styles/bundle.css +268 -268
- package/src/styles/index.css +33 -33
- package/src/types/Address.ts +7 -7
- package/src/types/ContentSection.ts +9 -9
- package/src/types/GetListingParams.ts +8 -8
- package/src/types/LatLng.ts +4 -4
- package/src/types/ListingEntity.ts +11 -11
- package/src/types/ListingFields.ts +25 -25
- package/src/types/Listings.ts +32 -32
- package/src/types/Recruiter.ts +9 -9
- package/src/types/SimilarListing.ts +24 -24
- package/src/types/config/Colors.ts +8 -8
- package/src/types/config/MapConfig.ts +31 -31
- package/src/types/config/PointsOfInterestConfig.ts +13 -13
- package/src/types/config/SearchConfig.ts +4 -4
- package/src/util/filterUtil.js +2 -1
- package/src/util/mapIconUtil.js +180 -180
- package/src/util/mapUtil.js +92 -92
- package/dist/types/contexts/themeContext.d.ts +0 -11
package/dist/util/mapUtil.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\n\tconst clusters = {};\n\n\tif (!listingEntitiesDetails) return [];\n\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\n\tif (closeItemPairs.length > 0) {\n\t\tlistingEntitiesDetails = adjustItemPositions(\n\t\t\tlistingEntitiesDetails,\n\t\t\tcloseItemPairs\n\t\t);\n\t}\n\n\titems?.forEach(item => {\n\t\tif(item.entityId !== -1){\n\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\n\n\t\t\tif (!entityDetails) {\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\titem.mapDetails = entityDetails;\n\n\t\t\tif (!clusters[item.entityId]) {\n\t\t\t\tclusters[item.entityId] = {\n\t\t\t\t\t...item.mapDetails,\n\t\t\t\t\titems: { [item.id]: item }\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\n\t\t\t}}\n\t});\n\n\treturn Object.values(clusters);\n};\n\nexport const findCloseItems = itemsObj => {\n\tconst closeItems = [];\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\n\tconst proximityThreshold = 0.0001;\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\tfor (let j = i + 1; j < items.length; j++) {\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\n\t\t\tif (\n\t\t\t\tdistanceLat < proximityThreshold &&\n\t\t\t\tdistanceLng < proximityThreshold\n\t\t\t) {\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn closeItems;\n};\n\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\n\tconst adjustmentValue = 0.0001;\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\n\n\tcloseItemPairs.forEach(pair => {\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\n\t\t}\n\t});\n\n\treturn adjustedItems;\n};\n\nexport const clusterOptions = (clusterGridSize, fillColor) => {\n\treturn {\n\t\tgridSize: clusterGridSize,\n\t\tmaxZoom:15,\n\t\tstyles:[{\n\t\t\turl: createSvgDataUri(fillColor),\n\t\t\ttextColor:'white',\n\t\t\theight: 40,\n\t\t\twidth: 40\n\t\t}]\n\t};\n};\n\nfunction createSvgDataUri(fillColor) {\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\n\t</svg>`;\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","maxZoom","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,IAAAA,KAAK,CAAEO,OAAO,CAAC,UAAAC,IAAI,EAAI;AACtB,IAAA,IAAGA,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC,EAAC;AAEvB,MAAA,IAAMC,aAAa,GAAGT,sBAAsB,CAACO,IAAI,CAACC,QAAQ,CAAC,CAAA;MAE3D,IAAI,CAACC,aAAa,EAAE;QACnBC,OAAO,CAACC,KAAK,CAAAC,kCAAAA,CAAAA,MAAA,CAAoCL,IAAI,CAACC,QAAQ,CAAE,CAAC,CAAA;AACjE,QAAA,OAAA;AACD,OAAA;MAEAD,IAAI,CAACM,UAAU,GAAGJ,aAAa,CAA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AAAA,GAAG,EAAEC,gBAAgB,CAACL,SAAS,CAAC;AAChCM,MAAAA,SAAS,EAAC,OAAO;AACjBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GACD,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACL,SAAS,EAAE;AACpC,EAAA,IAAMS,GAAG,GAAA,yHAAA,CAAAnC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCoC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
|
|
1
|
+
{"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\r\n\tconst clusters = {};\r\n\r\n\tif (!listingEntitiesDetails) return [];\r\n\r\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\r\n\tif (closeItemPairs.length > 0) {\r\n\t\tlistingEntitiesDetails = adjustItemPositions(\r\n\t\t\tlistingEntitiesDetails,\r\n\t\t\tcloseItemPairs\r\n\t\t);\r\n\t}\r\n\r\n\titems?.forEach(item => {\r\n\t\tif(item.entityId !== -1){\r\n\r\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\r\n\r\n\t\t\tif (!entityDetails) {\r\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\titem.mapDetails = entityDetails;\r\n\r\n\t\t\tif (!clusters[item.entityId]) {\r\n\t\t\t\tclusters[item.entityId] = {\r\n\t\t\t\t\t...item.mapDetails,\r\n\t\t\t\t\titems: { [item.id]: item }\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\r\n\t\t\t}}\r\n\t});\r\n\r\n\treturn Object.values(clusters);\r\n};\r\n\r\nexport const findCloseItems = itemsObj => {\r\n\tconst closeItems = [];\r\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\r\n\tconst proximityThreshold = 0.0001;\r\n\r\n\tfor (let i = 0; i < items.length; i++) {\r\n\t\tfor (let j = i + 1; j < items.length; j++) {\r\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\r\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\r\n\t\t\tif (\r\n\t\t\t\tdistanceLat < proximityThreshold &&\r\n\t\t\t\tdistanceLng < proximityThreshold\r\n\t\t\t) {\r\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn closeItems;\r\n};\r\n\r\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\r\n\tconst adjustmentValue = 0.0001;\r\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\r\n\r\n\tcloseItemPairs.forEach(pair => {\r\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\r\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\r\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\r\n\t\t}\r\n\t});\r\n\r\n\treturn adjustedItems;\r\n};\r\n\r\nexport const clusterOptions = (clusterGridSize, fillColor) => {\r\n\treturn {\r\n\t\tgridSize: clusterGridSize,\r\n\t\tmaxZoom:15,\r\n\t\tstyles:[{\r\n\t\t\turl: createSvgDataUri(fillColor),\r\n\t\t\ttextColor:'white',\r\n\t\t\theight: 40,\r\n\t\t\twidth: 40\r\n\t\t}]\r\n\t};\r\n};\r\n\r\nfunction createSvgDataUri(fillColor) {\r\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\r\n\t</svg>`;\r\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\r\n}\r\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","maxZoom","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,IAAAA,KAAK,CAAEO,OAAO,CAAC,UAAAC,IAAI,EAAI;AACtB,IAAA,IAAGA,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC,EAAC;AAEvB,MAAA,IAAMC,aAAa,GAAGT,sBAAsB,CAACO,IAAI,CAACC,QAAQ,CAAC,CAAA;MAE3D,IAAI,CAACC,aAAa,EAAE;QACnBC,OAAO,CAACC,KAAK,CAAAC,kCAAAA,CAAAA,MAAA,CAAoCL,IAAI,CAACC,QAAQ,CAAE,CAAC,CAAA;AACjE,QAAA,OAAA;AACD,OAAA;MAEAD,IAAI,CAACM,UAAU,GAAGJ,aAAa,CAAA;AAE/B,MAAA,IAAI,CAACR,QAAQ,CAACM,IAAI,CAACC,QAAQ,CAAC,EAAE;A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AAO;AACjBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GACD,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACL,SAAS,EAAE;AACpC,EAAA,IAAMS,GAAG,GAAA,yHAAA,CAAAnC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCoC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abcagency/hc-ui-components",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "UI Components for HireControl",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist",
|
|
8
|
-
"src"
|
|
9
|
-
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "cross-env NODE_ENV=production rollup -c",
|
|
12
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"hirecontrol",
|
|
16
|
-
"ui",
|
|
17
|
-
"components"
|
|
18
|
-
],
|
|
19
|
-
"author": "Aloysius Butler & Clark",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@headlessui/react": "^1.7.19",
|
|
23
|
-
"@iconify/react": "^4.1.1",
|
|
24
|
-
"@radix-ui/react-accordion": "^1.1.2",
|
|
25
|
-
"@radix-ui/react-dialog": "^1.0.5",
|
|
26
|
-
"@radix-ui/react-select": "^2.0.0",
|
|
27
|
-
"@radix-ui/react-tabs": "^1.0.4",
|
|
28
|
-
"@react-google-maps/api": "^2.19.3",
|
|
29
|
-
"@testing-library/react": "^13.4.0",
|
|
30
|
-
"ajv": "^8.16.0",
|
|
31
|
-
"ajv-keywords": "^5.1.0",
|
|
32
|
-
"framer-motion": "^10.18.0",
|
|
33
|
-
"fuse.js": "^7.0.0",
|
|
34
|
-
"npm": "^10.8.1",
|
|
35
|
-
"react-router-dom": "^6.23.1",
|
|
36
|
-
"react-scripts": "5.0.1",
|
|
37
|
-
"react-wrap-balancer": "^1.1.1",
|
|
38
|
-
"rollup-plugin-filesize": "^10.0.0",
|
|
39
|
-
"rollup-plugin-progress": "^1.1.2",
|
|
40
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
41
|
-
"tailwind-merge": "^2.2.0",
|
|
42
|
-
"use-places-autocomplete": "^4.0.1",
|
|
43
|
-
"web-vitals": "^2.1.4"
|
|
44
|
-
},
|
|
45
|
-
"resolutions": {
|
|
46
|
-
"react": "^18.3.1",
|
|
47
|
-
"react-dom": "^18.3.1"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@babel/cli": "^7.24.6",
|
|
51
|
-
"@babel/core": "^7.24.6",
|
|
52
|
-
"@babel/eslint-parser": "^7.24.6",
|
|
53
|
-
"@babel/preset-env": "^7.24.6",
|
|
54
|
-
"@babel/preset-react": "^7.24.6",
|
|
55
|
-
"@iconify/react": "^4.1.1",
|
|
56
|
-
"@rollup/plugin-alias": "^5.1.0",
|
|
57
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
58
|
-
"@rollup/plugin-commonjs": "^25.0.8",
|
|
59
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
60
|
-
"@rollup/plugin-replace": "^5.0.5",
|
|
61
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
62
|
-
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
63
|
-
"@tailwindcss/forms": "^0.5.7",
|
|
64
|
-
"@tailwindcss/typography": "^0.5.13",
|
|
65
|
-
"@types/node": "^20.14.2",
|
|
66
|
-
"@types/react": "^18.3.3",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
68
|
-
"@typescript-eslint/parser": "^7.13.0",
|
|
69
|
-
"autoprefixer": "^10.4.19",
|
|
70
|
-
"cross-env": "^7.0.3",
|
|
71
|
-
"dotenv": "^16.4.5",
|
|
72
|
-
"eslint": "^8.57.0",
|
|
73
|
-
"eslint-config-prettier": "^9.1.0",
|
|
74
|
-
"eslint-plugin-import": "^2.29.1",
|
|
75
|
-
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
76
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
77
|
-
"eslint-plugin-react": "^7.34.2",
|
|
78
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
79
|
-
"npm-force-resolutions": "^0.0.10",
|
|
80
|
-
"postcss": "^8.4.38",
|
|
81
|
-
"postcss-prefixer": "^3.0.0",
|
|
82
|
-
"postcss-preset-env": "^9.5.14",
|
|
83
|
-
"rollup": "^4.18.0",
|
|
84
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
85
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
86
|
-
"tailwindcss": "^3.4.3",
|
|
87
|
-
"tailwindcss-animate": "^1.0.7",
|
|
88
|
-
"typescript": "^4.9.5"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abcagency/hc-ui-components",
|
|
3
|
+
"version": "1.3.60",
|
|
4
|
+
"description": "UI Components for HireControl",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "cross-env NODE_ENV=production rollup -c",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"hirecontrol",
|
|
16
|
+
"ui",
|
|
17
|
+
"components"
|
|
18
|
+
],
|
|
19
|
+
"author": "Aloysius Butler & Clark",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@headlessui/react": "^1.7.19",
|
|
23
|
+
"@iconify/react": "^4.1.1",
|
|
24
|
+
"@radix-ui/react-accordion": "^1.1.2",
|
|
25
|
+
"@radix-ui/react-dialog": "^1.0.5",
|
|
26
|
+
"@radix-ui/react-select": "^2.0.0",
|
|
27
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
28
|
+
"@react-google-maps/api": "^2.19.3",
|
|
29
|
+
"@testing-library/react": "^13.4.0",
|
|
30
|
+
"ajv": "^8.16.0",
|
|
31
|
+
"ajv-keywords": "^5.1.0",
|
|
32
|
+
"framer-motion": "^10.18.0",
|
|
33
|
+
"fuse.js": "^7.0.0",
|
|
34
|
+
"npm": "^10.8.1",
|
|
35
|
+
"react-router-dom": "^6.23.1",
|
|
36
|
+
"react-scripts": "5.0.1",
|
|
37
|
+
"react-wrap-balancer": "^1.1.1",
|
|
38
|
+
"rollup-plugin-filesize": "^10.0.0",
|
|
39
|
+
"rollup-plugin-progress": "^1.1.2",
|
|
40
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
41
|
+
"tailwind-merge": "^2.2.0",
|
|
42
|
+
"use-places-autocomplete": "^4.0.1",
|
|
43
|
+
"web-vitals": "^2.1.4"
|
|
44
|
+
},
|
|
45
|
+
"resolutions": {
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@babel/cli": "^7.24.6",
|
|
51
|
+
"@babel/core": "^7.24.6",
|
|
52
|
+
"@babel/eslint-parser": "^7.24.6",
|
|
53
|
+
"@babel/preset-env": "^7.24.6",
|
|
54
|
+
"@babel/preset-react": "^7.24.6",
|
|
55
|
+
"@iconify/react": "^4.1.1",
|
|
56
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
57
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
58
|
+
"@rollup/plugin-commonjs": "^25.0.8",
|
|
59
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
60
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
61
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
62
|
+
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
63
|
+
"@tailwindcss/forms": "^0.5.7",
|
|
64
|
+
"@tailwindcss/typography": "^0.5.13",
|
|
65
|
+
"@types/node": "^20.14.2",
|
|
66
|
+
"@types/react": "^18.3.3",
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
68
|
+
"@typescript-eslint/parser": "^7.13.0",
|
|
69
|
+
"autoprefixer": "^10.4.19",
|
|
70
|
+
"cross-env": "^7.0.3",
|
|
71
|
+
"dotenv": "^16.4.5",
|
|
72
|
+
"eslint": "^8.57.0",
|
|
73
|
+
"eslint-config-prettier": "^9.1.0",
|
|
74
|
+
"eslint-plugin-import": "^2.29.1",
|
|
75
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
76
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
77
|
+
"eslint-plugin-react": "^7.34.2",
|
|
78
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
79
|
+
"npm-force-resolutions": "^0.0.10",
|
|
80
|
+
"postcss": "^8.4.38",
|
|
81
|
+
"postcss-prefixer": "^3.0.0",
|
|
82
|
+
"postcss-preset-env": "^9.5.14",
|
|
83
|
+
"rollup": "^4.18.0",
|
|
84
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
85
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
86
|
+
"tailwindcss": "^3.4.3",
|
|
87
|
+
"tailwindcss-animate": "^1.0.7",
|
|
88
|
+
"typescript": "^4.9.5"
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/.editorconfig
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# EditorConfig is awesome: http://EditorConfig.org
|
|
2
|
-
root = true
|
|
3
|
-
|
|
4
|
-
[*]
|
|
5
|
-
charset = utf-8
|
|
6
|
-
end_of_line = lf
|
|
7
|
-
indent_style = tab
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
|
|
11
|
-
[*.md]
|
|
12
|
-
trim_trailing_whitespace = false
|
|
1
|
+
# EditorConfig is awesome: http://EditorConfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
indent_style = tab
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.md]
|
|
12
|
+
trim_trailing_whitespace = false
|
package/src/bundleIndex.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import HireControlMap from '~/components/HireControlMap';
|
|
4
|
-
|
|
5
|
-
const initializeComponent = (elementId, props) => {
|
|
6
|
-
const element = document.getElementById(elementId);
|
|
7
|
-
if (element) {
|
|
8
|
-
ReactDOM.render(<div className='hc-bundle'><HireControlMap {...props} /></div>, element);
|
|
9
|
-
} else {
|
|
10
|
-
console.error(`Element with id ${elementId} not found`);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { HireControlMap, initializeComponent };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import HireControlMap from '~/components/HireControlMap';
|
|
4
|
+
|
|
5
|
+
const initializeComponent = (elementId, props) => {
|
|
6
|
+
const element = document.getElementById(elementId);
|
|
7
|
+
if (element) {
|
|
8
|
+
ReactDOM.render(<div className='hc-bundle'><HireControlMap {...props} /></div>, element);
|
|
9
|
+
} else {
|
|
10
|
+
console.error(`Element with id ${elementId} not found`);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { HireControlMap, initializeComponent };
|
|
@@ -1,142 +1,148 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useLoadScript } from '@react-google-maps/api';
|
|
3
|
-
|
|
4
|
-
import Grid from '~/components/modules/grid';
|
|
5
|
-
import Filter from '~/components/containers/filter/filter-container';
|
|
6
|
-
import MapList from '~/components/containers/maps/map-list-container';
|
|
7
|
-
|
|
8
|
-
import { MapProvider } from '~/contexts/mapContext';
|
|
9
|
-
import { PlacesProvider } from '~/contexts/placesContext';
|
|
10
|
-
import { MapListProvider } from '~/contexts/mapListContext';
|
|
11
|
-
import { TrackEventProvider } from '~/contexts/trackEventContext';
|
|
12
|
-
|
|
13
|
-
import { getMapConfig } from '~/services/configService';
|
|
14
|
-
import { setClientAuthKey } from '~/clientToken.js';
|
|
15
|
-
|
|
16
|
-
import '../styles/index.css';
|
|
17
|
-
import { ThemeProvider } from '~/contexts/themeContext';
|
|
18
|
-
|
|
19
|
-
const libraries = ['places'];
|
|
20
|
-
|
|
21
|
-
export const HireControlMap = ({
|
|
22
|
-
clientToken,
|
|
23
|
-
navigateToDetails = null,
|
|
24
|
-
navigateToEasyApply = null,
|
|
25
|
-
handleUrlUpdate = null,
|
|
26
|
-
Link = null,
|
|
27
|
-
linkFormat = '/jobs/[slug]',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useLoadScript } from '@react-google-maps/api';
|
|
3
|
+
|
|
4
|
+
import Grid from '~/components/modules/grid';
|
|
5
|
+
import Filter from '~/components/containers/filter/filter-container';
|
|
6
|
+
import MapList from '~/components/containers/maps/map-list-container';
|
|
7
|
+
|
|
8
|
+
import { MapProvider } from '~/contexts/mapContext';
|
|
9
|
+
import { PlacesProvider } from '~/contexts/placesContext';
|
|
10
|
+
import { MapListProvider } from '~/contexts/mapListContext';
|
|
11
|
+
import { TrackEventProvider } from '~/contexts/trackEventContext';
|
|
12
|
+
|
|
13
|
+
import { getMapConfig } from '~/services/configService';
|
|
14
|
+
import { setClientAuthKey } from '~/clientToken.js';
|
|
15
|
+
|
|
16
|
+
import '../styles/index.css';
|
|
17
|
+
import { ThemeProvider } from '~/contexts/themeContext';
|
|
18
|
+
|
|
19
|
+
const libraries = ['places'];
|
|
20
|
+
|
|
21
|
+
export const HireControlMap = ({
|
|
22
|
+
clientToken,
|
|
23
|
+
navigateToDetails = null,
|
|
24
|
+
navigateToEasyApply = null,
|
|
25
|
+
handleUrlUpdate = null,
|
|
26
|
+
Link = null,
|
|
27
|
+
linkFormat = '/jobs/[slug]',
|
|
28
|
+
easyApplyUrl = null,
|
|
29
|
+
easyApplyText = 'Easy Apply',
|
|
30
|
+
trackEvent = (eventType, eventObj) => {console.log(eventType); console.log(eventObj);},
|
|
31
|
+
listings = [],
|
|
32
|
+
setFiltersUrl = null
|
|
33
|
+
}) => {
|
|
34
|
+
const [siteConfig, setSiteconfig] = useState(null);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setClientAuthKey(clientToken);
|
|
38
|
+
const fetchSiteConfig = async () => {
|
|
39
|
+
try {
|
|
40
|
+
const configData = await getMapConfig(clientToken);
|
|
41
|
+
setSiteconfig(configData);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('Failed to fetch site configuration:', error);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
fetchSiteConfig();
|
|
48
|
+
}, [clientToken]);
|
|
49
|
+
|
|
50
|
+
const { isLoaded } = useLoadScript({
|
|
51
|
+
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
|
|
52
|
+
version: 'quarterly',
|
|
53
|
+
libraries: libraries
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div>
|
|
58
|
+
{isLoaded && siteConfig && (
|
|
59
|
+
<HomeBody
|
|
60
|
+
siteConfig={siteConfig}
|
|
61
|
+
navigateToDetails={navigateToDetails}
|
|
62
|
+
navigateToEasyApply={navigateToEasyApply}
|
|
63
|
+
Link={Link}
|
|
64
|
+
linkFormat={linkFormat}
|
|
65
|
+
easyApplyUrl={easyApplyUrl}
|
|
66
|
+
easyApplyText={easyApplyText}
|
|
67
|
+
trackEvent={trackEvent}
|
|
68
|
+
listings={listings}
|
|
69
|
+
setFiltersUrl={setFiltersUrl}
|
|
70
|
+
handleUrlUpdate={handleUrlUpdate}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const HomeBody = ({ siteConfig, navigateToDetails, navigateToEasyApply, Link, linkFormat, easyApplyUrl, easyApplyText, trackEvent, listings, setFiltersUrl, handleUrlUpdate }) => {
|
|
78
|
+
const resetFilters = false;
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<TrackEventProvider trackEvent={trackEvent}>
|
|
82
|
+
<ThemeProvider uiText={siteConfig.colors.uiText} uiAccent={siteConfig.colors.uiAccent} primary={siteConfig.colors.primary} primaryDark={siteConfig.colors.primaryDark} secondary={siteConfig.colors.secondary} secondaryDark={siteConfig.colors.secondaryDark}>
|
|
83
|
+
<MapListProvider
|
|
84
|
+
siteConfig={siteConfig}
|
|
85
|
+
resetFilters={resetFilters}
|
|
86
|
+
navigateToDetails={navigateToDetails}
|
|
87
|
+
navigateToEasyApply={navigateToEasyApply}
|
|
88
|
+
Link={Link}
|
|
89
|
+
linkFormat={linkFormat}
|
|
90
|
+
easyApplyUrl={easyApplyUrl}
|
|
91
|
+
easyApplyText={easyApplyText}
|
|
92
|
+
listings={listings}
|
|
93
|
+
setFiltersUrl={setFiltersUrl}
|
|
94
|
+
handleUrlUpdate={handleUrlUpdate}
|
|
95
|
+
>
|
|
96
|
+
<MapProvider resetFilters={resetFilters}>
|
|
97
|
+
<PlacesProvider
|
|
98
|
+
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
99
|
+
markerColors={{
|
|
100
|
+
fillColor: siteConfig.colors.primary,
|
|
101
|
+
strokeColor: siteConfig.colors.primaryDark,
|
|
102
|
+
selectedFillColor: siteConfig.colors.secondary,
|
|
103
|
+
selectedStrokeColor: siteConfig.colors.secondaryDark,
|
|
104
|
+
placeMarkers: {
|
|
105
|
+
colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
|
|
106
|
+
size: siteConfig.pointsOfInterestConfig.placeMarkerSize
|
|
107
|
+
}
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<Grid
|
|
111
|
+
as='section'
|
|
112
|
+
id='job-search-interface'
|
|
113
|
+
columns='md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'
|
|
114
|
+
gap='hc-gap-0'
|
|
115
|
+
autoRows={false}
|
|
116
|
+
className='hc-bundle hc-items-stretch hc-h-screen hc-min-h-[30rem] hc-divide-x hc-divide-uiAccent/20'
|
|
117
|
+
>
|
|
118
|
+
<Grid.Item className='hc-bg-gray-100'>
|
|
119
|
+
<Filter showMap={siteConfig.showMap} className='hc-hidden md:hc-block' />
|
|
120
|
+
</Grid.Item>
|
|
121
|
+
<MapList
|
|
122
|
+
markerConfigs={{
|
|
123
|
+
fillColor: siteConfig.colors.primary,
|
|
124
|
+
strokeColor: siteConfig.colors.primaryDark,
|
|
125
|
+
selectedFillColor: siteConfig.colors.secondary,
|
|
126
|
+
selectedStrokeColor: siteConfig.colors.secondaryDark,
|
|
127
|
+
placeMarkers: {
|
|
128
|
+
colors: siteConfig.pointsOfInterestConfig.placeMarkerColors,
|
|
129
|
+
size: siteConfig.pointsOfInterestConfig.placeMarkerSize
|
|
130
|
+
}
|
|
131
|
+
}}
|
|
132
|
+
mapPosition={siteConfig.mapPosition}
|
|
133
|
+
showMap={siteConfig.showMap}
|
|
134
|
+
fieldsShown={siteConfig.fieldsShown}
|
|
135
|
+
specialFeatures={siteConfig.specialFeatures}
|
|
136
|
+
fieldNames={siteConfig.fieldNames}
|
|
137
|
+
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
138
|
+
/>
|
|
139
|
+
</Grid>
|
|
140
|
+
</PlacesProvider>
|
|
141
|
+
</MapProvider>
|
|
142
|
+
</MapListProvider>
|
|
143
|
+
</ThemeProvider>
|
|
144
|
+
</TrackEventProvider>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default HireControlMap;
|