@@ -8,13 +8,8 @@ import Typography from 'material-ui/Typography'
8
8
import styles from './ProjectDetail.scss'
9
9
10
10
class ProjectDetail extends Component {
11
- constructor ( args ) {
12
- super ( args )
13
- this . state = { projectId : this . props . match . params . id }
14
- }
15
-
16
11
componentDidMount ( ) {
17
- this . props . fetchProjectById ( this . state . projectId )
12
+ this . props . fetchProjectById ( this . props . match . params . id )
18
13
}
19
14
20
15
renderApplication ( application ) {
@@ -36,8 +31,8 @@ class ProjectDetail extends Component {
36
31
}
37
32
38
33
render ( ) {
39
- const project = this . props . project || { }
40
- const applications = project . applications || [ ]
34
+ const project = this . props . project || { } ;
35
+ const applications = project . applications || [ ] ;
41
36
return applications . length === 0 ? (
42
37
< div >
43
38
< h1 > No one had applied this project</ h1 >
@@ -61,16 +56,16 @@ class ProjectDetail extends Component {
61
56
62
57
const mapDispatchToProps = {
63
58
fetchProjectById : ProjectActionCreator . fetchProjectById
64
- }
59
+ } ;
65
60
66
61
const mapStateToProperties = ( state ) => {
67
62
return { project : state . project . project || { } }
68
- }
63
+ } ;
69
64
70
65
ProjectDetail . propTypes = {
71
66
project : PropTypes . object ,
72
67
fetchProjectById : PropTypes . func ,
73
68
match : PropTypes . object
74
- }
69
+ } ;
75
70
76
71
export default connect ( mapStateToProperties , mapDispatchToProps ) ( ProjectDetail )
0 commit comments