fix and updated Dashboard and Routes

This commit is contained in:
britea 2020-03-13 15:12:28 +01:00
parent b60a7bdcd0
commit 8bebf974e1

View File

@ -1,11 +1,13 @@
import React, {Component} from 'react';
import DevicePanel from "../components/dashboard/DevicePanel";
import NavbarTest from './NavbarTest'
import MyHeader from '../components/HeaderController'
import { call } from '../client_server';
import {Button} from 'semantic-ui-react';
import { Menu } from 'semantic-ui-react'
import { Grid, Image, Icon } from 'semantic-ui-react'
import NavbarTest from './NavbarTest'
export default class Dashboard extends Component{
constructor(props) {
@ -19,7 +21,7 @@ export default class Dashboard extends Component{
this.handleItemClick = this.handleItemClick.bind(this);
}
UNSAFE_componentWillMount() {
componentDidMount() {
call.getAllRooms(this.props.token)
.then(res => {
res.data.forEach((e) => {
@ -60,19 +62,17 @@ export default class Dashboard extends Component{
render () {
return(
<div style={{height : "110vh"}}>
<Button color='blue' fluid size='large' onClick={this.addRoom}>
Add Room
</Button>
<Grid>
<Grid.Row>
<div style={{height : "110vh", background: '#1b1c1d'}}>
<MyHeader />
<Grid >
<Grid.Row color='black'>
<Grid.Column width={3}>
<NavbarTest rooms={this.state.rooms} handleItemClick={this.handleItemClick}/>
<NavbarTest addRoom={this.addRoom} rooms={this.state.rooms} handleItemClick={this.handleItemClick}/>
</Grid.Column>
<Grid.Column width={13}>
<DevicePanel />
</Grid.Column>
</Grid.Column>
</Grid.Row>
</Grid>
</div>