Estágio Escola Superior de Tecnologia de Setúbal. https://www.estsetubal.ips.pt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

89 lines
2.4 KiB

import React, { Component } from "react";
import GraficoPublicacoes from "../../components/GraficoPublicacoes/index.jsx";
import MyButton from "../../components/MyButton/index.jsx";
import TabelaPessoas from "../../components/TabelaPessoas/index.jsx";
import "./index.less";
export default class DashboardContainer extends Component {
constructor(props) {
super(props);
this.state = {
counter: 0
};
this.button = React.createRef();
this.click = this.click.bind(this);
}
componentWillMount() {
/*
// Basic sample of the service call:
fetch('/services/my-test.netuno', {
credentials: 'include'
}).then((response) => {
return response.json();
}).then((json) => {
// json...;
});
*/
/*
// Better sample of the recommended way to call services:
const fail = ()=> {
this.setState({ loading: false });
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/my-data-service',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
param1: 'value1',
param2: 'value2'
}),
success: (response)=> {
console.log(response);
if (response.json) {
this.setState({
loading: false,
data: response.json
});
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
*/
}
componentDidUpdate(prevProps, prevState, snapshot) {
$(this.button.current).fadeOut(250).fadeIn(250);
}
click() {
this.setState({ counter: this.state.counter + 1 });
}
render() {
const { counter } = this.state;
return (
<div className="my-dashboard">
<TabelaPessoas />
<GraficoPublicacoes />
</div>
);
}
}