|
@@ -1,27 +1,5 @@
|
|
|
import React from "react";
|
|
|
-import { getGoogleApiKey } from "../services/ggsh.service";
|
|
|
-import Loading from "./loading.component";
|
|
|
|
|
|
-const withGoogleApiKey = ComposedComponent =>
|
|
|
- class extends React.Component {
|
|
|
- constructor(props) {
|
|
|
- super(props);
|
|
|
- this.state = { googleApiKey: null }
|
|
|
- }
|
|
|
-
|
|
|
- async componentDidMount() {
|
|
|
- const googleApiKey = await getGoogleApiKey();
|
|
|
- this.setState({ googleApiKey });
|
|
|
- }
|
|
|
-
|
|
|
- render() {
|
|
|
- const { googleApiKey } = this.state;
|
|
|
- if (!googleApiKey) {
|
|
|
- return <Loading/>
|
|
|
- }
|
|
|
-
|
|
|
- return <ComposedComponent {...this.props} googleApiKey={googleApiKey} />
|
|
|
- }
|
|
|
- }
|
|
|
+const withGoogleApiKey = ComposedComponent => props => <ComposedComponent {...props} googleApiKey="AIzaSyCDtEWf192OYuMvd2cp8a04DYQo-RU_sXs" />
|
|
|
|
|
|
export default withGoogleApiKey;
|