mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-05 20:10:57 +00:00
These are all the files from the Tabler react repos, made to work with laravel and webpack.
This commit is contained in:
40
resources/js/GoogleMap/GoogleMap.react.js
vendored
Normal file
40
resources/js/GoogleMap/GoogleMap.react.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// @flow
|
||||
|
||||
import * as React from "react";
|
||||
import cn from "classnames";
|
||||
|
||||
import "./GoogleMap.css";
|
||||
|
||||
import {
|
||||
withScriptjs,
|
||||
withGoogleMap,
|
||||
GoogleMap as ReactGoogleMap,
|
||||
} from "react-google-maps";
|
||||
|
||||
const MapComponent: React.ElementType = withScriptjs(
|
||||
withGoogleMap(props => (
|
||||
<ReactGoogleMap
|
||||
defaultZoom={8}
|
||||
defaultCenter={{ lat: -34.397, lng: 150.644 }}
|
||||
disableDefaultUI={true}
|
||||
/>
|
||||
))
|
||||
);
|
||||
|
||||
type Props = {|
|
||||
+blackAndWhite?: boolean,
|
||||
|};
|
||||
|
||||
function GoogleMap({ blackAndWhite }: Props): React.Node {
|
||||
const containerClasses = cn("GoogleMapContainer", { blackAndWhite });
|
||||
return (
|
||||
<MapComponent
|
||||
googleMapURL="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places"
|
||||
loadingElement={<div style={{ height: `100%` }} />}
|
||||
containerElement={<div className={containerClasses} />}
|
||||
mapElement={<div style={{ height: `100%` }} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default GoogleMap;
|
Reference in New Issue
Block a user