From 3f3ae121ef082a430f4bdc84ab7970a5633d552a Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Wed, 29 Apr 2020 15:13:20 +0200 Subject: Frontend checkpoint --- frontend/src/views/MainPane.js | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 frontend/src/views/MainPane.js (limited to 'frontend/src/views/MainPane.js') 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 ( +
+
+
+
+ +
+
+ +
+
+
+
+ ); + } +} + +export default withRouter(MainPane); -- cgit v1.2.3-70-g09d2