diff --git a/src/components/start/Start.jsx b/src/components/start/Start.jsx deleted file mode 100644 index 2966516..0000000 --- a/src/components/start/Start.jsx +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2020 Thomas Hintz -// -// This file is part of the Alpha Centauri Farming project. -// -// The Alpha Centauri Farming project is free software: you can -// redistribute it and/or modify it under the terms of the GNU General -// Public License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// -// The Alpha Centauri Farming project is distributed in the hope that -// it will be useful, but WITHOUT ANY WARRANTY; without even the -// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with the Alpha Centauri Farming project. If not, see -// . - -import React, { Fragment } from 'react' -import { connect } from 'react-redux' - -import { GroupBox, Row, Col } from '../widgets.jsx' -import { startOrJoinGame } from './actions.js' - -const JoinGameScreens = { list: 'list', details: 'details' }; - -class JoinGameComp extends React.Component { - constructor(props) { - super(props); - this.state = { - screen: JoinGameScreens.list, - game: null - }; - } - - handleClickGame = game => { - this.setState({ screen: JoinGameScreens.details, - game: game - }); - } - - handleBack = e => { - this.setState({ screen: JoinGameScreens.list }); - } - - handleJoinAsExisting = e => { - this.props.startOrJoinGame({ type: 'join-as-existing', - playerName: e.target.text, - gameName: this.state.game.name }); - } - - render() { - return ( - - - - {this.state.screen === JoinGameScreens.list ? - () - : ( -

back to games

-

Game: {this.state.game.name}

-

Join as existing player:

-
    - {this.state.game.players.map((p, i) => - (
  • - - {p} - -
  • ))} -
- -
)} - -
-
- ); - } -} - -const JoinGame = connect( - null, - { startOrJoinGame } -)(JoinGameComp)