1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import { withStyles } from 'material-ui/styles' ;
4
+ import Icon from 'material-ui/Icon' ;
5
+ import IconButton from 'material-ui/IconButton' ;
6
+ import { gotoProfile } from '../action-creators/global-actions' ;
7
+
8
+ import { bindActionCreators } from 'redux' ;
9
+ import { connect } from 'react-redux' ;
10
+
4
11
5
12
const styles = theme => ( {
6
13
wrapper : {
7
- borderBottom : `1px solid ${ theme . text . secondary } `
14
+ borderBottom : `1px solid ${ theme . palette . text . secondary } ` ,
15
+ padding : '10px' ,
16
+ height : '50px'
17
+ } ,
18
+ content : {
19
+ marginTop : '7px' ,
20
+ display : 'inline-block'
21
+ } ,
22
+ iconBtn : {
23
+ border : `1px solid ${ theme . palette . text . secondary } ` ,
24
+ borderRadius : '100%' ,
25
+ width : '40px' ,
26
+ height : '40px'
27
+ } ,
28
+ icon : {
29
+ fontSize : '32px'
30
+ } ,
31
+ nameText : {
32
+ fontSize : '20px' ,
33
+ marginLeft : '10px'
34
+ } ,
35
+ mainText : {
36
+ fontSize : '20px' ,
37
+ position : 'relative' ,
38
+ top : '-10px' ,
39
+ left : '10px'
40
+ } ,
41
+ subText : {
42
+ display : 'grid' ,
43
+ fontSize : '16px' ,
44
+ color : theme . palette . text . secondary ,
45
+ marginLeft : '50px' ,
46
+ marginTop : '-16px'
47
+ } ,
48
+ actionIcons : {
49
+ float : 'right' ,
50
+ display : 'inline-block' ,
51
+ marginTop : '5px'
52
+ } ,
53
+ msgIconBtn : {
54
+ border : `2px solid blue` ,
55
+ borderRadius : '100%' ,
56
+ width : '40px' ,
57
+ height : '40px' ,
58
+ marginRight : '5px'
59
+ } ,
60
+ msgIcon : {
61
+ color : 'blue'
62
+ } ,
63
+ removeIconBtn : {
64
+ border : `2px solid red` ,
65
+ borderRadius : '100%' ,
66
+ width : '40px' ,
67
+ height : '40px'
68
+
69
+ } ,
70
+ removeIcon : {
71
+ color : 'red'
8
72
}
9
73
} )
10
74
11
75
const UserBaseInline = props => (
12
76
< div className = { props . classes . wrapper } >
13
- User
77
+ < div className = { props . classes . content } >
78
+ < IconButton
79
+ className = { props . classes . iconBtn }
80
+ onClick = { ( ) => props . gotoProfile ( props . data . id ) }
81
+ >
82
+ < Icon className = { props . classes . icon } > account_circle</ Icon >
83
+ </ IconButton >
84
+ < span className = { props . classes . nameText } > { props . data . first_name } { props . data . last_name } </ span >
85
+ </ div >
86
+ < div className = { props . classes . actionIcons } >
87
+ < IconButton
88
+ className = { props . classes . msgIconBtn }
89
+ >
90
+ < Icon className = { props . classes . msgIcon } > message</ Icon >
91
+ </ IconButton >
92
+ < IconButton
93
+ className = { props . classes . removeIconBtn }
94
+ >
95
+ < Icon className = { props . classes . removeIcon } > clear</ Icon >
96
+ </ IconButton >
97
+ </ div >
14
98
</ div >
15
99
)
16
100
@@ -22,10 +106,25 @@ const RewardBaseInline = props => (
22
106
23
107
const ActivityBaseInline = props => (
24
108
< div className = { props . classes . wrapper } >
25
- Activity
109
+ < div className = { props . classes . content } >
110
+ < IconButton
111
+ className = { props . classes . iconBtn }
112
+ >
113
+ < Icon className = { props . classes . icon } > group_work</ Icon >
114
+ </ IconButton >
115
+ < span className = { props . classes . mainText } > { props . data . name } </ span >
116
+ < span className = { props . classes . subText } > { props . data . playerIds . length } Players</ span >
117
+ </ div >
26
118
</ div >
27
119
)
28
120
29
- export const UserInline = withStyles ( styles ) ( UserBaseInline ) ;
121
+ const mapDispatchToProps = dispatch => bindActionCreators ( {
122
+ gotoProfile : gotoProfile ,
123
+ } , dispatch ) ;
124
+
125
+ export const UserInline = connect (
126
+ null ,
127
+ mapDispatchToProps
128
+ ) ( withStyles ( styles ) ( UserBaseInline ) ) ;
30
129
export const RewardInline = withStyles ( styles ) ( RewardBaseInline ) ;
31
130
export const ActivityInline = withStyles ( styles ) ( ActivityBaseInline ) ;
0 commit comments