@@ -47,7 +47,7 @@ const styles = theme => ({
47
47
48
48
class ProposalListing extends Component {
49
49
render ( ) {
50
- const { date, description, badges, isFollowing, classes, theme } = this . props ;
50
+ const { id , date, description, badges, isFollowing, classes, theme, follow , show } = this . props ;
51
51
const [ year , month , day ] = date . split ( '-' ) ;
52
52
53
53
return (
@@ -68,15 +68,28 @@ class ProposalListing extends Component {
68
68
) ;
69
69
} ) }
70
70
</ div >
71
- < Typography variant = "body2" paragraph className = { classes . description } >
71
+ < Typography
72
+ variant = "body2"
73
+ paragraph
74
+ className = { classes . description }
75
+ >
72
76
{ description }
73
77
</ Typography >
74
78
< div className = { classes . actions } >
75
- < Button variant = "raised" color = "primary" >
79
+ < Button
80
+ variant = "raised"
81
+ color = "primary"
82
+ onClick = { ( ) => show ( id ) }
83
+ >
76
84
Timeline
77
85
</ Button >
78
86
{ isFollowing ? null :
79
- < Button variant = "raised" color = "secondary" className = { classes . button } >
87
+ < Button
88
+ variant = "raised"
89
+ color = "secondary"
90
+ className = { classes . button }
91
+ onClick = { ( ) => follow ( id ) }
92
+ >
80
93
Urmareste
81
94
</ Button >
82
95
}
@@ -88,10 +101,13 @@ class ProposalListing extends Component {
88
101
}
89
102
90
103
ProposalListing . propTypes = {
104
+ id : PropTypes . number . isRequired ,
91
105
date : PropTypes . string . isRequired ,
92
106
description : PropTypes . string . isRequired ,
93
107
badges : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
94
- isFollowing : PropTypes . bool . isRequired
108
+ isFollowing : PropTypes . bool . isRequired ,
109
+ follow : PropTypes . func . isRequired ,
110
+ show : PropTypes . func . isRequired
95
111
} ;
96
112
97
113
export default withStyles ( styles , { withTheme : true } ) ( ProposalListing ) ;
0 commit comments