@selfcommunity/react-ui 0.11.0-mui7.13 → 0.11.0-mui7.14

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.
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const system_1 = require("@mui/system");
7
- const api_1 = require("@react-google-maps/api");
7
+ const react_google_maps_1 = require("@vis.gl/react-google-maps");
8
8
  const react_core_1 = require("@selfcommunity/react-core");
9
9
  const types_1 = require("@selfcommunity/types");
10
10
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
@@ -67,12 +67,6 @@ function EventLocationWidget(inProps) {
67
67
  const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
68
68
  // HOOKS
69
69
  const { isLoaded, geocodingApiKey } = (0, react_core_1.useSCGoogleApiLoader)();
70
- const mapOptions = {
71
- fullscreenControl: false,
72
- mapTypeControl: false,
73
- streetViewControl: false,
74
- zoomControl: false // Disables the zoom control (+/- buttons)
75
- };
76
70
  if (!geocodingApiKey || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === types_1.SCEventLocationType.ONLINE) {
77
71
  return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
78
72
  }
@@ -85,12 +79,12 @@ function EventLocationWidget(inProps) {
85
79
  /**
86
80
  * Renders root object
87
81
  */
88
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.map }, { children: (0, jsx_runtime_1.jsx)(api_1.GoogleMap, Object.assign({ mapContainerClassName: classes.map, center: {
89
- lat: scEvent.geolocation_lat,
90
- lng: scEvent.geolocation_lng
91
- }, options: mapOptions, zoom: 15 }, { children: (0, jsx_runtime_1.jsx)(api_1.MarkerF, { position: {
82
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.map }, { children: (0, jsx_runtime_1.jsx)(react_google_maps_1.APIProvider, Object.assign({ apiKey: geocodingApiKey }, { children: (0, jsx_runtime_1.jsx)(react_google_maps_1.Map, Object.assign({ className: classes.map, center: {
92
83
  lat: scEvent.geolocation_lat,
93
84
  lng: scEvent.geolocation_lng
94
- } }) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent.geolocation, true) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.address }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent.geolocation) }))] }) })));
85
+ }, zoom: 15, fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: (0, jsx_runtime_1.jsx)(react_google_maps_1.Marker, { position: {
86
+ lat: scEvent.geolocation_lat,
87
+ lng: scEvent.geolocation_lng
88
+ } }) })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent.geolocation, true) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.address }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent.geolocation) }))] }) })));
95
89
  }
96
90
  exports.default = EventLocationWidget;
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Box, CardContent, Typography, styled } from '@mui/material';
4
4
  import { useThemeProps } from '@mui/system';
5
- import { GoogleMap, MarkerF } from '@react-google-maps/api';
5
+ import { APIProvider, Map, Marker } from '@vis.gl/react-google-maps';
6
6
  import { useSCGoogleApiLoader, useSCFetchEvent } from '@selfcommunity/react-core';
7
7
  import { SCEventLocationType } from '@selfcommunity/types';
8
8
  import classNames from 'classnames';
@@ -65,12 +65,6 @@ export default function EventLocationWidget(inProps) {
65
65
  const { scEvent } = useSCFetchEvent({ id: eventId, event });
66
66
  // HOOKS
67
67
  const { isLoaded, geocodingApiKey } = useSCGoogleApiLoader();
68
- const mapOptions = {
69
- fullscreenControl: false,
70
- mapTypeControl: false,
71
- streetViewControl: false,
72
- zoomControl: false // Disables the zoom control (+/- buttons)
73
- };
74
68
  if (!geocodingApiKey || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === SCEventLocationType.ONLINE) {
75
69
  return _jsx(HiddenPlaceholder, {});
76
70
  }
@@ -83,11 +77,11 @@ export default function EventLocationWidget(inProps) {
83
77
  /**
84
78
  * Renders root object
85
79
  */
86
- return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(CardContent, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: _jsx(FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), _jsx(Box, Object.assign({ className: classes.map }, { children: _jsx(GoogleMap, Object.assign({ mapContainerClassName: classes.map, center: {
87
- lat: scEvent.geolocation_lat,
88
- lng: scEvent.geolocation_lng
89
- }, options: mapOptions, zoom: 15 }, { children: _jsx(MarkerF, { position: {
80
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(CardContent, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: _jsx(FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), _jsx(Box, Object.assign({ className: classes.map }, { children: _jsx(APIProvider, Object.assign({ apiKey: geocodingApiKey }, { children: _jsx(Map, Object.assign({ className: classes.map, center: {
90
81
  lat: scEvent.geolocation_lat,
91
82
  lng: scEvent.geolocation_lng
92
- } }) })) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: formatEventLocationGeolocation(scEvent.geolocation, true) })), _jsx(Typography, Object.assign({ variant: "body1", className: classes.address }, { children: formatEventLocationGeolocation(scEvent.geolocation) }))] }) })));
83
+ }, zoom: 15, fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: _jsx(Marker, { position: {
84
+ lat: scEvent.geolocation_lat,
85
+ lng: scEvent.geolocation_lng
86
+ } }) })) })) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: formatEventLocationGeolocation(scEvent.geolocation, true) })), _jsx(Typography, Object.assign({ variant: "body1", className: classes.address }, { children: formatEventLocationGeolocation(scEvent.geolocation) }))] }) })));
93
87
  }