diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-12 16:50:45 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:06:00 +0200 |
| commit | f3dbecbf55832df686d6969756640f6f5853f996 (patch) | |
| tree | dc70c5a04e77f6138f86fcd04b2ca9c808bf5037 /src/pages | |
| parent | cbf8eb9cbf2f4082cb1a83955d435ebcb73be3ab (diff) | |
Add experiments route
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/App.js | 4 | ||||
| -rw-r--r-- | src/pages/Experiments.js | 36 | ||||
| -rw-r--r-- | src/pages/Profile.js | 2 | ||||
| -rw-r--r-- | src/pages/Simulations.js | 4 |
4 files changed, 40 insertions, 6 deletions
diff --git a/src/pages/App.js b/src/pages/App.js index 21b3c445..8254853d 100644 --- a/src/pages/App.js +++ b/src/pages/App.js @@ -1,5 +1,5 @@ import PropTypes from "prop-types"; -import React from 'react'; +import React from "react"; import {connect} from "react-redux"; import {ShortcutManager} from "react-shortcuts"; import {openSimulationSucceeded} from "../actions/simulations"; @@ -40,7 +40,7 @@ class AppContainer extends React.Component { render() { return ( <div className="page-container full-height"> - <AppNavbar/> + <AppNavbar simulationId={this.props.simulationId} inSimulation={true}/> {this.props.datacenterIsLoading ? <div className="full-height d-flex align-items-center justify-content-center"> <LoadingScreen/> diff --git a/src/pages/Experiments.js b/src/pages/Experiments.js new file mode 100644 index 00000000..b35916e5 --- /dev/null +++ b/src/pages/Experiments.js @@ -0,0 +1,36 @@ +import PropTypes from "prop-types"; +import React from "react"; +import {connect} from "react-redux"; +import AppNavbar from "../components/navigation/AppNavbar"; + +class ExperimentsContainer extends React.Component { + static propTypes = { + simulationId: PropTypes.number.isRequired, + }; + + componentDidMount() { + // TODO fetch experiments + } + + render() { + return ( + <div className="full-height"> + <AppNavbar simulationId={this.props.simulationId} inSimulation={true}/> + <div className="container text-page-container full-height"> + Test + </div> + </div> + ); + } +} + +const mapDispatchToProps = dispatch => { + return {}; +}; + +const Experiments = connect( + undefined, + mapDispatchToProps +)(ExperimentsContainer); + +export default Experiments; diff --git a/src/pages/Profile.js b/src/pages/Profile.js index ca09d0f4..c8805c6f 100644 --- a/src/pages/Profile.js +++ b/src/pages/Profile.js @@ -6,7 +6,7 @@ import DeleteProfileModal from "../containers/modals/DeleteProfileModal"; const ProfileContainer = ({onDelete}) => ( <div className="full-height"> - <AppNavbar/> + <AppNavbar inSimulation={false}/> <div className="container text-page-container full-height"> <button className="btn btn-danger" onClick={onDelete}>Delete my account on OpenDC</button> <p> diff --git a/src/pages/Simulations.js b/src/pages/Simulations.js index c04c74ae..33e04a9d 100644 --- a/src/pages/Simulations.js +++ b/src/pages/Simulations.js @@ -1,7 +1,6 @@ import React from 'react'; import {connect} from "react-redux"; import {openNewSimulationModal} from "../actions/modals/simulations"; -import {addSimulation} from "../actions/simulations"; import {fetchAuthorizationsOfCurrentUser} from "../actions/users"; import AppNavbar from "../components/navigation/AppNavbar"; import SimulationFilterPanel from "../components/simulations/FilterPanel"; @@ -17,7 +16,7 @@ class SimulationsContainer extends React.Component { render() { return ( <div className="full-height"> - <AppNavbar/> + <AppNavbar inSimulation={false}/> <div className="container text-page-container full-height"> <SimulationFilterPanel/> <VisibleSimulationList/> @@ -33,7 +32,6 @@ const mapDispatchToProps = dispatch => { return { fetchAuthorizationsOfCurrentUser: () => dispatch(fetchAuthorizationsOfCurrentUser()), openNewSimulationModal: () => dispatch(openNewSimulationModal()), - addSimulation: (text) => dispatch(addSimulation(text)), }; }; |
