diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-21 12:08:41 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:43 +0200 |
| commit | 1b6545fa653df44b019f6676faed39880999b2bf (patch) | |
| tree | cb131975db09cdb401b082700e2075d462495897 /src/pages/App.js | |
| parent | 8a49e1eedebb6d4c47edf6fd1a7545ea502d59e7 (diff) | |
Add basic react-konva rendering prototype
Diffstat (limited to 'src/pages/App.js')
| -rw-r--r-- | src/pages/App.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/pages/App.js b/src/pages/App.js new file mode 100644 index 00000000..a2a1050b --- /dev/null +++ b/src/pages/App.js @@ -0,0 +1,45 @@ +import PropTypes from "prop-types"; +import React from 'react'; +import {connect} from "react-redux"; +import {openSimulationSucceeded} from "../actions/simulations"; +import {fetchAuthorizationsOfCurrentUser} from "../actions/users"; +import MapStage from "../components/map/MapStage"; +import Navbar from "../components/navigation/Navbar"; +import Login from "../containers/auth/Login"; + +class AppContainer extends React.Component { + static propTypes = { + simulationId: PropTypes.number.isRequired, + }; + + componentDidMount() { + this.props.storeSimulationId(this.props.simulationId); + this.props.fetchAuthorizationsOfCurrentUser(); + } + + render() { + return ( + <div className="full-height"> + <Navbar/> + <div className="full-height"> + <MapStage/> + </div> + <Login visible={false}/> + </div> + ); + } +} + +const mapDispatchToProps = dispatch => { + return { + storeSimulationId: id => dispatch(openSimulationSucceeded(id)), + fetchAuthorizationsOfCurrentUser: () => dispatch(fetchAuthorizationsOfCurrentUser()), + }; +}; + +const App = connect( + undefined, + mapDispatchToProps +)(AppContainer); + +export default App; |
