diff options
author | Emiliano Ciavatta | 2020-04-29 13:13:20 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-04-29 13:13:20 +0000 |
commit | 3f3ae121ef082a430f4bdc84ab7970a5633d552a (patch) | |
tree | dc08aea5263e33d9b456bf03a99a33bc261a723d /frontend/src/views/MainPane.js | |
parent | d1eeb1a6b3eed3c666cc6f94ba2a932abbce8515 (diff) |
Frontend checkpoint
Diffstat (limited to 'frontend/src/views/MainPane.js')
-rw-r--r-- | frontend/src/views/MainPane.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/frontend/src/views/MainPane.js b/frontend/src/views/MainPane.js new file mode 100644 index 0000000..88b5376 --- /dev/null +++ b/frontend/src/views/MainPane.js @@ -0,0 +1,49 @@ +import React, {Component} from 'react'; +import './MainPane.scss'; +import Connections from "./Connections"; +import ConnectionContent from "../components/ConnectionContent"; +import {withRouter} from "react-router-dom"; +import axios from 'axios' + +class MainPane extends Component { + + constructor(props) { + super(props); + this.state = { + id: null, + }; + } + + componentDidUpdate() { + if (this.props.match.params.id !== this.state.id) { + const id = this.props.match.params.id; + this.setState({id: id}); + + axios.get(`/api/streams/${id}`).then(res => this.setState({connectionContent: res.data})) + + + } + } + + componentDidMount() { + } + + render() { + return ( + <div className="main-pane"> + <div className="container-fluid"> + <div className="row"> + <div className="col-md-6 pane"> + <Connections/> + </div> + <div className="col-md-6 pl-0 pane"> + <ConnectionContent connectionPayload={this.state.connectionContent}/> + </div> + </div> + </div> + </div> + ); + } +} + +export default withRouter(MainPane); |