]> git.xn--bdkaa.com Git - where-are-you.py.git/commitdiff
City selection
authorzharkovstas <zharkovstas@skbkontur.ru>
Sun, 19 May 2019 06:16:12 +0000 (11:16 +0500)
committerzharkovstas <zharkovstas@skbkontur.ru>
Sun, 19 May 2019 06:16:12 +0000 (11:16 +0500)
src/Game.js
src/Welcome.js
src/routes.js

index e1eb68b59c1a1114c790c949c7a6dcc87b697c1c..516e3e3cfe878a4e6e191253721017508dba44d8 100644 (file)
@@ -27,7 +27,7 @@ export class Game extends Component {
   }
 
   componentDidMount() {
-    this.gameController.createGame('Екатеринбург').then(() => this.gameController.loadTips()).then(() => {
+    this.gameController.createGame(this.props.city).then(() => this.gameController.loadTips()).then(() => {
       this.setState({
         tips: this.handleVarlamov(this.gameController.tips()),
         hasMoreTips: this.gameController.hasMoreTips(),
index bd51101b72a7a0ba260f74aded0d0b8fa74cfbac..7665c82ddfea8a5ead8a22c525d7f617525a8e50 100644 (file)
@@ -11,8 +11,32 @@ export function Welcome() {
         <p>
           Where are you
         </p>
-        <Link href="/game">
-          Начать
+        <p>
+          Выберите город
+        </p>
+        <Link href="/game/Екатеринбург">
+          Екатеринбург
+        </Link>
+        <Link href="/game/Санкт-Петербург">
+          Санкт-Петербург
+        </Link>
+        <Link href="/game/Новосибирск">
+          Новосибирск
+        </Link>
+        <Link href="/game/Пермь">
+          Пермь
+        </Link>
+        <Link href="/game/Ижевск">
+          Ижевск
+        </Link>
+        <Link href="/game/Казань">
+          Казань
+        </Link>
+        <Link href="/game/Самара">
+          Самара
+        </Link>
+        <Link href="/game/Лондон">
+          Лондон
         </Link>
       </header>
     </AppLayout>
index 17fea76ea7885510a61e5a564dce84dfd1cf6d3a..7282a56b61dad74162bd8f3936a74c32001869a6 100644 (file)
@@ -10,8 +10,8 @@ export const routes = [
     action: Welcome
   },
   {
-    path: '/game',
-    action: () => <Game/>
+    path: '/game/:city',
+    action: (context) => <Game city={context.params.city}/>
   },
   {
     path: '(.*)',