From: zharkovstas Date: Sun, 19 May 2019 06:16:12 +0000 (+0500) Subject: City selection X-Git-Url: https://git.xn--bdkaa.com/?a=commitdiff_plain;h=5e50c9da984be7ce1d184f527e2d942458b633a3;p=where-are-you.py.git City selection --- diff --git a/src/Game.js b/src/Game.js index e1eb68b..516e3e3 100644 --- a/src/Game.js +++ b/src/Game.js @@ -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(), diff --git a/src/Welcome.js b/src/Welcome.js index bd51101..7665c82 100644 --- a/src/Welcome.js +++ b/src/Welcome.js @@ -11,8 +11,32 @@ export function Welcome() {

Where are you

- - Начать +

+ Выберите город +

+ + Екатеринбург + + + Санкт-Петербург + + + Новосибирск + + + Пермь + + + Ижевск + + + Казань + + + Самара + + + Лондон diff --git a/src/routes.js b/src/routes.js index 17fea76..7282a56 100644 --- a/src/routes.js +++ b/src/routes.js @@ -10,8 +10,8 @@ export const routes = [ action: Welcome }, { - path: '/game', - action: () => + path: '/game/:city', + action: (context) => }, { path: '(.*)',