blob: 8ce64b9de923ff3d81e0dc23dec7acace342db84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import './overview.css'
// import actions from 'app/actions'
import { Loader } from 'app/common'
import { groupResponseBy } from 'app/utils/api.utils'
class OverviewContainer extends Component {
state = {
ready: true,
}
constructor(props) {
super(props)
}
componentDidMount() {
this.build()
}
componentDidUpdate(prevProps) {
if (!this.state.ready) {
this.build()
}
}
build() {
if (this.props.loading) return
// const episodes = groupResponseBy(this.props.episodes, 'project_id')
// const venues = groupResponseBy(this.props.venues, 'project_id')
// this.setState({ ready: true, episodes, venues })
}
render() {
const { loading, projects } = this.props
const { episodes, venues, ready } = this.state
if (loading || !ready) {
return (
<div className='dashboard'>
<Loader />
</div>
)
}
return (
<div className='dashboard overview'>
<div className='project-top'>
<div className='row project-heading'>
<div className='title'>
<h1>Episode</h1>
</div>
</div>
</div>
</div>
)
}
}
const mapStateToProps = state => ({
})
export default connect(mapStateToProps)(OverviewContainer)
|