@cashub/ui 0.34.3 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/map/GoogleMap.js +22 -1
  2. package/package.json +1 -1
package/map/GoogleMap.js CHANGED
@@ -29,7 +29,8 @@ const GoogleMap = _ref => {
29
29
  data = {
30
30
  defaultPosition: null,
31
31
  position: null,
32
- locations: []
32
+ locations: [],
33
+ message: null
33
34
  },
34
35
  geoFence = false,
35
36
  geoFenceOptions = {},
@@ -102,6 +103,7 @@ const GoogleMap = _ref => {
102
103
  defaultPosition: data.defaultPosition,
103
104
  position: data.position,
104
105
  locations: validLocations,
106
+ message: data.message,
105
107
  bounds: validBounds,
106
108
  geoFence: geoFence,
107
109
  geoFenceOptions: geoFenceOptions,
@@ -120,6 +122,7 @@ const Map = _ref2 => {
120
122
  defaultPosition,
121
123
  position,
122
124
  locations,
125
+ message,
123
126
  bounds,
124
127
  geoFence,
125
128
  geoFenceOptions,
@@ -392,6 +395,24 @@ const Map = _ref2 => {
392
395
  };
393
396
  }
394
397
  }, [map, geoFence, geoFenceOptions.latitude, geoFenceOptions.longitude, geoFenceOptions.radius, geoFenceOptions.minRadius, geoFenceOptions.editable, geoFenceOptions.eventHandlers]);
398
+
399
+ // show message
400
+ (0, _react.useEffect)(() => {
401
+ if (map && message) {
402
+ const messageContainer = document.createElement('p');
403
+ messageContainer.style.margin = 'var(--spacing-s)';
404
+ messageContainer.style.padding = 'var(--spacing-xs)';
405
+ messageContainer.style.boxShadow = 'var(--box-shadow)';
406
+ messageContainer.style.border = 'none';
407
+ messageContainer.style.borderRadius = 'var(--border-radius-s)';
408
+ messageContainer.style.cursor = 'pointer';
409
+ messageContainer.style.color = 'rgb(0, 0, 0)';
410
+ messageContainer.style.backgroundColor = 'rgb(255, 255, 255)';
411
+ messageContainer.style.fontSize = 'var(--font-body1)';
412
+ messageContainer.textContent = message;
413
+ map.controls[window.google.maps.ControlPosition.CENTER].push(messageContainer);
414
+ }
415
+ }, [map, message]);
395
416
  (0, _react.useEffect)(() => {
396
417
  if (ref.current && !map) {
397
418
  setMap(new window.google.maps.Map(ref.current, {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.34.3",
3
+ "version": "0.35.1",
4
4
  "private": false,
5
5
  "author": "CasHUB Team",
6
6
  "description": "CasHUB UI components library",