Skip to content

Commit

Permalink
Add station to the game
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMuschol-at committed Sep 4, 2023
1 parent 0d789c6 commit 7a522a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -6,6 +6,7 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"lodash": "^4.17.21",
"mapbox-gl": "^2.15.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
4 changes: 4 additions & 0 deletions src/App.js
Expand Up @@ -2,6 +2,7 @@ import "./App.css";

import "mapbox-gl/dist/mapbox-gl.css";

import _ from "lodash";
import { useState } from "react";
import { Map, Marker } from "react-map-gl";

Expand All @@ -15,6 +16,8 @@ const initialViewState = {

function GameplayMap() {
const [guess, setGuess] = useState(null);
const station = _.sample(allStations);

let guessMarker = null;
let guessMessage = null;
if (guess !== null) {
Expand All @@ -31,6 +34,7 @@ function GameplayMap() {

return (
<div>
<h1>{station.name}</h1>
<Map
style={{ width: 800, height: 800 }}
mapStyle="mapbox://styles/mapbox/streets-v9"
Expand Down

0 comments on commit 7a522a1

Please sign in to comment.