diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-31 17:59:51 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:50 +0200 |
| commit | 3f736cd3db63f106eac02f220477b4a0f3b0eceb (patch) | |
| tree | 80afa73f8c4d281b2fccba8ad2baa7c10f7e7e84 /src/containers/map/TileContainer.js | |
| parent | b17f1d8cb4815f57a4b7043cc91b867ec3cbc867 (diff) | |
Implement room creation
Diffstat (limited to 'src/containers/map/TileContainer.js')
| -rw-r--r-- | src/containers/map/TileContainer.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/containers/map/TileContainer.js b/src/containers/map/TileContainer.js index 0456c423..d00c3611 100644 --- a/src/containers/map/TileContainer.js +++ b/src/containers/map/TileContainer.js @@ -2,17 +2,18 @@ import {connect} from "react-redux"; import {goFromRoomToObject} from "../../actions/interaction-level"; import TileGroup from "../../components/map/groups/TileGroup"; -const mapStateToProps = state => { +const mapStateToProps = (state, ownProps) => { return { - interactionLevel: state.interactionLevel + interactionLevel: state.interactionLevel, + tile: state.objects.tile[ownProps.tileId], }; }; -const mapDispatchToProps = (dispatch, ownProps) => { +const mapDispatchToProps = dispatch => { return { - onClick: () => { - if (ownProps.tile.objectType) { - dispatch(goFromRoomToObject(ownProps.tile.id)) + onClick: tile => { + if (tile.objectType) { + dispatch(goFromRoomToObject(tile.id)) } } }; |
