@@ -13,101 +13,105 @@ const styles = theme => ({
13
13
alignItems : 'center'
14
14
} ,
15
15
listingContent : {
16
- padding : theme . spacing . unit ,
17
- display : 'flex' ,
18
- flexDirection : 'column' ,
19
- width : '100%'
16
+ padding : theme . spacing . unit ,
17
+ display : 'flex' ,
18
+ flexDirection : 'column' ,
19
+ width : '100%'
20
20
} ,
21
21
date : {
22
- padding : 3 * theme . spacing . unit ,
23
- fontWeight : 600 ,
24
- textAlign : 'center' ,
25
- [ theme . breakpoints . down ( 'xs' ) ] : {
26
- padding : 2 * theme . spacing . unit
27
- }
22
+ padding : 3 * theme . spacing . unit ,
23
+ fontWeight : 600 ,
24
+ textAlign : 'center' ,
25
+ [ theme . breakpoints . down ( 'xs' ) ] : {
26
+ padding : 2 * theme . spacing . unit
27
+ }
28
28
} ,
29
29
actions : {
30
- display : 'flex' ,
31
- justifyContent : 'flex-end'
30
+ display : 'flex' ,
31
+ justifyContent : 'flex-end'
32
32
} ,
33
33
button : {
34
34
marginLeft : theme . spacing . unit
35
35
} ,
36
36
badge : {
37
- marginRight : theme . spacing . unit ,
38
- height : '25px'
37
+ marginRight : theme . spacing . unit ,
38
+ height : '25px'
39
39
} ,
40
40
description : {
41
- marginTop : '5px' ,
42
- [ theme . breakpoints . down ( 'xs' ) ] : {
43
- lineHeight : '1.4em'
44
- }
41
+ marginTop : '5px' ,
42
+ [ theme . breakpoints . down ( 'xs' ) ] : {
43
+ lineHeight : '1.4em'
44
+ }
45
45
}
46
46
} ) ;
47
47
48
48
class ProposalListing extends Component {
49
- render ( ) {
50
- const { id, date, description, badges, isFollowing, classes, theme, follow, show } = this . props ;
51
- const [ year , month , day ] = date . split ( '-' ) ;
52
-
53
- return (
54
- < Paper className = { classes . listing } >
55
- < Typography className = { classes . date } >
56
- { `${ day } .${ month } ` } < br /> { year }
57
- </ Typography >
58
- < div className = { classes . listingContent } >
59
- < div >
60
- { badges . map ( ( badge , idx ) => {
61
- return (
62
- < Chip
63
- key = { idx }
64
- label = { < Typography > { badge . label } </ Typography > }
65
- style = { { backgroundColor : badge . color } }
66
- className = { classes . badge }
67
- />
68
- ) ;
69
- } ) }
70
- </ div >
71
- < Typography
72
- variant = "body2"
73
- paragraph
74
- className = { classes . description }
75
- >
76
- { description }
77
- </ Typography >
78
- < div className = { classes . actions } >
79
- < Button
80
- variant = "raised"
81
- color = "primary"
82
- onClick = { ( ) => show ( id ) }
83
- >
84
- Timeline
85
- </ Button >
86
- { isFollowing ? null :
87
- < Button
88
- variant = "raised"
89
- color = "secondary"
90
- className = { classes . button }
91
- onClick = { ( ) => follow ( id ) }
92
- >
93
- Urmareste
94
- </ Button >
95
- }
96
- </ div >
97
- </ div >
98
- </ Paper >
99
- ) ;
100
- }
49
+ render ( ) {
50
+ const {
51
+ id,
52
+ date,
53
+ description,
54
+ badges,
55
+ isFollowing,
56
+ classes,
57
+ theme,
58
+ follow,
59
+ show
60
+ } = this . props ;
61
+ const [ year , month , day ] = date . split ( '-' ) ;
62
+
63
+ return (
64
+ < Paper className = { classes . listing } >
65
+ < Typography className = { classes . date } >
66
+ { `${ day } .${ month } ` }
67
+ < br />
68
+ { year }
69
+ </ Typography >
70
+ < div className = { classes . listingContent } >
71
+ < div >
72
+ { badges . map ( ( badge , idx ) => {
73
+ return (
74
+ < Chip
75
+ key = { idx }
76
+ label = { < Typography > { badge . label } </ Typography > }
77
+ style = { { backgroundColor : badge . color } }
78
+ className = { classes . badge }
79
+ />
80
+ ) ;
81
+ } ) }
82
+ </ div >
83
+ < Typography variant = "body2" paragraph className = { classes . description } >
84
+ { description }
85
+ </ Typography >
86
+ < div className = { classes . actions } >
87
+ < Button variant = "raised" color = "primary" onClick = { ( ) => show ( id ) } >
88
+ Timeline
89
+ </ Button >
90
+ { isFollowing ? null : (
91
+ < Button
92
+ variant = "raised"
93
+ color = "secondary"
94
+ className = { classes . button }
95
+ onClick = { ( ) => follow ( id ) }
96
+ >
97
+ Urmareste
98
+ </ Button >
99
+ ) }
100
+ </ div >
101
+ </ div >
102
+ </ Paper >
103
+ ) ;
104
+ }
101
105
}
102
106
103
107
ProposalListing . propTypes = {
104
- id : PropTypes . number . isRequired ,
105
- date : PropTypes . string . isRequired ,
106
- description : PropTypes . string . isRequired ,
107
- badges : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
108
- isFollowing : PropTypes . bool . isRequired ,
109
- follow : PropTypes . func . isRequired ,
110
- show : PropTypes . func . isRequired
108
+ id : PropTypes . number . isRequired ,
109
+ date : PropTypes . string . isRequired ,
110
+ description : PropTypes . string . isRequired ,
111
+ badges : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
112
+ isFollowing : PropTypes . bool . isRequired ,
113
+ follow : PropTypes . func . isRequired ,
114
+ show : PropTypes . func . isRequired
111
115
} ;
112
116
113
117
export default withStyles ( styles , { withTheme : true } ) ( ProposalListing ) ;
0 commit comments