|
|
|
@ -1,10 +1,16 @@ |
|
|
|
import React, { Component } from "react"; |
|
|
|
import MyButton from "../../components/MyButton/index.jsx"; |
|
|
|
import Spin from 'antd/lib/spin'; |
|
|
|
import notification from 'antd/lib/notification'; |
|
|
|
import "./index.less"; |
|
|
|
|
|
|
|
import Spin from 'antd/lib/spin'; |
|
|
|
import Tabs from 'antd/lib/tabs'; |
|
|
|
|
|
|
|
import TableUsers from "../../components/TableUsers/index.jsx"; |
|
|
|
import UserCalendar from "../../components/UserCalendar/index.jsx"; |
|
|
|
import UserDrawer from '../../components/UserDrawer/index.jsx'; |
|
|
|
import EventsChart from '../../components/EventsChart/index.jsx'; |
|
|
|
import MyButton from "../../components/MyButton/index.jsx"; |
|
|
|
|
|
|
|
const { TabPane } = Tabs; |
|
|
|
|
|
|
|
export default class DashboardContainer extends Component { |
|
|
|
constructor(props) { |
|
|
|
@ -13,16 +19,17 @@ export default class DashboardContainer extends Component { |
|
|
|
counter: 0, |
|
|
|
title: 'Bom Dia!', |
|
|
|
loading: false, |
|
|
|
user: null |
|
|
|
user: null, |
|
|
|
visible: false |
|
|
|
}; |
|
|
|
|
|
|
|
this.button = React.createRef(); |
|
|
|
this.click = this.click.bind(this); |
|
|
|
this.openCalendar = this.openCalendar.bind(this); |
|
|
|
this.closeCalendar = this.closeCalendar.bind(this); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.showDrawer = this.showDrawer.bind(this); |
|
|
|
this.closeDrawer = this.closeDrawer.bind(this); |
|
|
|
} |
|
|
|
|
|
|
|
componentWillMount() { |
|
|
|
console.log("will mount") |
|
|
|
@ -44,8 +51,18 @@ export default class DashboardContainer extends Component { |
|
|
|
|
|
|
|
click() { |
|
|
|
this.setState({ counter: this.state.counter + 1 }); |
|
|
|
console.log('visible: ', this.state.visible); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
showDrawer() { |
|
|
|
this.setState({visible: true}); |
|
|
|
}; |
|
|
|
|
|
|
|
closeDrawer() { |
|
|
|
this.setState({visible: false}); |
|
|
|
}; |
|
|
|
|
|
|
|
openCalendar(user) { |
|
|
|
this.setState({ user }); |
|
|
|
} |
|
|
|
@ -56,7 +73,7 @@ export default class DashboardContainer extends Component { |
|
|
|
|
|
|
|
render() { |
|
|
|
console.log("render"); |
|
|
|
const { counter, title, loading, user } = this.state; |
|
|
|
const { counter, title, loading, user, visible } = this.state; |
|
|
|
if (loading) { |
|
|
|
return <Spin/>; |
|
|
|
} |
|
|
|
@ -71,11 +88,28 @@ export default class DashboardContainer extends Component { |
|
|
|
} |
|
|
|
return ( |
|
|
|
<div className="my-dashboard"> |
|
|
|
|
|
|
|
<h1>Table Users</h1> |
|
|
|
<TableUsers onView={ this.openCalendar } /> |
|
|
|
<UserDrawer |
|
|
|
visible={visible} |
|
|
|
onClose={this.closeDrawer} |
|
|
|
/> |
|
|
|
|
|
|
|
<Tabs type="card"> |
|
|
|
<TabPane tab="Table Users" key="1"> |
|
|
|
<TableUsers |
|
|
|
onCalendar={ this.openCalendar } |
|
|
|
onList = { this.showDrawer } |
|
|
|
/> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane tab="Statistics" key="2"> |
|
|
|
<EventsChart /> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane tab="3" key="3"> |
|
|
|
Content of Tab Pane 3 |
|
|
|
</TabPane> |
|
|
|
</Tabs> |
|
|
|
|
|
|
|
<h1>Table...</h1> |
|
|
|
<div className="my-dashboard__button"> |
|
|
|
<MyButton |
|
|
|
mainRef={ this.button } |
|
|
|
|