Browse Source

Cleaning up the wiring in preparation for turning Game component into main driver

Kirk Trombley 5 năm trước cách đây
mục cha
commit
277bdd5a79
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      ui/src/App.js

+ 5 - 2
ui/src/App.js

@@ -139,6 +139,7 @@ class Game extends React.Component {
   constructor(props) {
     super(props);
     this.state = {
+      targetPoint: {lat: 42.57343, lng: 1.58651},
       selectedPoint: null,
     }
   }
@@ -146,14 +147,16 @@ class Game extends React.Component {
   handleSubmitGuess() {
     const { selectedPoint } = this.state;
     console.log(JSON.stringify(selectedPoint));
+    // TODO actually submit
   }
 
   render() {
+    const { selectedPoint, targetPoint } = this.state;
     return <GamePanel
       onSelectPoint={latLng => this.setState({selectedPoint: latLng})}
       onSubmitGuess={() => this.handleSubmitGuess()}
-      streetViewPoint={{lat: 42.57343, lng: 1.58651}}
-      selectedPoint={this.state.selectedPoint}
+      streetViewPoint={targetPoint}
+      selectedPoint={selectedPoint}
     />
   }