diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-26 13:53:21 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:45 +0200 |
| commit | bbb802b4142d11f020994ac4d9ae9c1610ac4038 (patch) | |
| tree | ea5419b2c1c0fc2af22c11e94b4981a9445ec26c /src/containers/map/TileContainer.js | |
| parent | 8302923a08728d36746af3560ebc35685c2b9da5 (diff) | |
Enable going from room to tile and back
Diffstat (limited to 'src/containers/map/TileContainer.js')
| -rw-r--r-- | src/containers/map/TileContainer.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/containers/map/TileContainer.js b/src/containers/map/TileContainer.js new file mode 100644 index 00000000..0456c423 --- /dev/null +++ b/src/containers/map/TileContainer.js @@ -0,0 +1,26 @@ +import {connect} from "react-redux"; +import {goFromRoomToObject} from "../../actions/interaction-level"; +import TileGroup from "../../components/map/groups/TileGroup"; + +const mapStateToProps = state => { + return { + interactionLevel: state.interactionLevel + }; +}; + +const mapDispatchToProps = (dispatch, ownProps) => { + return { + onClick: () => { + if (ownProps.tile.objectType) { + dispatch(goFromRoomToObject(ownProps.tile.id)) + } + } + }; +}; + +const TileContainer = connect( + mapStateToProps, + mapDispatchToProps +)(TileGroup); + +export default TileContainer; |
