diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-20 23:18:57 +0100 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-20 23:25:26 +0100 |
commit | cc3db2982dc22899a9ebea21e8a8dfbfd710f842 (patch) | |
tree | d8e138b300a8d8fded0651ac6be204d8c3342e68 /frontend/src/containers/gameBrowser.js | |
parent | Remove shitty code and move generator stars to the right (diff) | |
download | seven-wonders-cc3db2982dc22899a9ebea21e8a8dfbfd710f842.tar.gz seven-wonders-cc3db2982dc22899a9ebea21e8a8dfbfd710f842.tar.bz2 seven-wonders-cc3db2982dc22899a9ebea21e8a8dfbfd710f842.zip |
DUCKS! Refactor front architecture
Diffstat (limited to 'frontend/src/containers/gameBrowser.js')
-rw-r--r-- | frontend/src/containers/gameBrowser.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/src/containers/gameBrowser.js b/frontend/src/containers/gameBrowser.js new file mode 100644 index 00000000..9deb720b --- /dev/null +++ b/frontend/src/containers/gameBrowser.js @@ -0,0 +1,31 @@ +import React, { Component } from 'react' +import { connect } from 'react-redux' +import { Flex } from 'reflexbox' +import { Text, Space } from 'rebass' + +class GameBrowser extends Component { + + listGames = (games) => { + return games.valueSeq().map((game, index) => { + return (<Flex key={index}> + <Text>{game.get('name')}</Text> + <Space auto /> + <a href="#">Join</a> + </Flex>) + }) + } + + render() { + return ( + <div> + {this.listGames(this.props.games)} + </div> + ) + } +} + +const mapStateToProps = (state) => ({ + games: state.games +}) + +export default connect(mapStateToProps, {})(GameBrowser) |