|
@@ -4,24 +4,22 @@ import withGoogleApiKey from "./with-google-key.component";
|
|
// TODO eventually we want this to query and show other players
|
|
// TODO eventually we want this to query and show other players
|
|
// TODO also should show the actual location of the last round
|
|
// TODO also should show the actual location of the last round
|
|
|
|
|
|
-const RoundSummary = ({
|
|
|
|
- googleApiKey,
|
|
|
|
- roundNum,
|
|
|
|
- score,
|
|
|
|
- totalScore,
|
|
|
|
- onAdvanceState,
|
|
|
|
- buttonText,
|
|
|
|
- selectedPoint,
|
|
|
|
- targetPoint,
|
|
|
|
-}) => {
|
|
|
|
- // TODO determine zoom and center dynamically
|
|
|
|
|
|
+const RoundSummary = ({ googleApiKey, round, onNext }) => {
|
|
|
|
+ const {
|
|
|
|
+ roundNum,
|
|
|
|
+ selectedPoint,
|
|
|
|
+ targetPoint,
|
|
|
|
+ score,
|
|
|
|
+ totalScore,
|
|
|
|
+ } = round;
|
|
|
|
+ // TODO determine zoom and center dynamically, or make this a dynamic map
|
|
const mapUrl = `https://maps.googleapis.com/maps/api/staticmap?key=${googleApiKey}`;
|
|
const mapUrl = `https://maps.googleapis.com/maps/api/staticmap?key=${googleApiKey}`;
|
|
const size = `&size=600x400`
|
|
const size = `&size=600x400`
|
|
const zoom = `&zoom=5`;
|
|
const zoom = `&zoom=5`;
|
|
const centerOnTarget = `¢er=${targetPoint.lat},${targetPoint.lng}`;
|
|
const centerOnTarget = `¢er=${targetPoint.lat},${targetPoint.lng}`;
|
|
const targetMarker = `&markers=color:blue|label:T|${targetPoint.lat},${targetPoint.lng}`;
|
|
const targetMarker = `&markers=color:blue|label:T|${targetPoint.lat},${targetPoint.lng}`;
|
|
const selectedMarker = selectedPoint ? `&markers=color:red|label:S|${selectedPoint.lat},${selectedPoint.lng}` : ""
|
|
const selectedMarker = selectedPoint ? `&markers=color:red|label:S|${selectedPoint.lat},${selectedPoint.lng}` : ""
|
|
-
|
|
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div>
|
|
<div>
|
|
<img
|
|
<img
|
|
@@ -33,8 +31,8 @@ const RoundSummary = ({
|
|
<p>Score For Round {roundNum}: {score}</p>
|
|
<p>Score For Round {roundNum}: {score}</p>
|
|
<p>Running Total Score: {totalScore}</p>
|
|
<p>Running Total Score: {totalScore}</p>
|
|
<button
|
|
<button
|
|
- onClick={onAdvanceState}>
|
|
|
|
- {buttonText}
|
|
|
|
|
|
+ onClick={onNext}>
|
|
|
|
+ {roundNum === "5" ? "View Summary" : "Next Round"}
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|