mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-27 15:05:15 +02:00
34 lines
896 B
JavaScript
34 lines
896 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React, { useContext } from 'react';
|
|
import connectToStores from 'fluxible-addons-react/connectToStores';
|
|
import MapBottomsheetContext from './MapBottomsheetContext';
|
|
import withGeojsonObjects from './withGeojsonObjects';
|
|
import Map from './Map';
|
|
|
|
function MapContainer({ className, children, ...props }) {
|
|
const contextPadding = useContext(MapBottomsheetContext);
|
|
return (
|
|
<div className={`map ${className}`}>
|
|
<Map {...props} bottomPadding={contextPadding} />
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
MapContainer.propTypes = {
|
|
className: PropTypes.string,
|
|
children: PropTypes.node,
|
|
};
|
|
|
|
MapContainer.defaultProps = {
|
|
className: '',
|
|
children: undefined,
|
|
};
|
|
|
|
export default connectToStores(
|
|
withGeojsonObjects(MapContainer),
|
|
['PreferencesStore'],
|
|
context => ({
|
|
lang: context.getStore('PreferencesStore').getLanguage(),
|
|
}),
|
|
);
|