@@ -8,6 +8,7 @@ import PT from 'prop-types';
8
8
import { Link } from 'react-router-dom' ;
9
9
import { getRatingColor } from 'utils/tc' ;
10
10
import Th from 'assets/images/th.svg' ;
11
+ import DefaultPortrait from 'assets/images/ico-user-default.svg' ;
11
12
import {
12
13
shouldShowGraph , getHistory , getSubTrackStats , getSummary , getDetails ,
13
14
} from 'utils/memberStats' ;
@@ -64,6 +65,8 @@ class ProfileStats extends React.Component {
64
65
const subTrackStats = getSubTrackStats ( stats , track , subTrack ) ;
65
66
const subTrackSummary = getSummary ( stats , track , subTrack ) || [ ] ;
66
67
const subTrackDetails = getDetails ( stats , track , subTrack ) || [ ] ;
68
+ const ratingObj = subTrackSummary . filter ( k => k . label === 'rating' ) ;
69
+ const subTrackRating = ratingObj ? ratingObj [ 0 ] . value : 0 ;
67
70
68
71
if ( track === 'DEVELOP' ) {
69
72
const reliability = subTrackSummary . find ( stat => stat . label === 'reliability' ) ;
@@ -128,6 +131,23 @@ Active Challenges
128
131
}
129
132
</ ul >
130
133
< ul styleName = "subtrack-stats" >
134
+ {
135
+ subTrackSummary
136
+ && (
137
+ < li key = { info . handle } >
138
+ < div >
139
+ { info . photoURL ? < img src = { info . photoURL } onError = { this . loadImageError } styleName = "profile-circle" alt = "Member Portait" /> : < DefaultPortrait styleName = "profile-circle" /> }
140
+ </ div >
141
+ < div
142
+ styleName = "value"
143
+ className = { info . maxRating ? styles . rating : '' }
144
+ style = { { color : subTrackRating ? getRatingColor ( parseInt ( subTrackRating . replace ( / \D / g, '' ) , 10 ) ) : undefined } }
145
+ >
146
+ { info . handle || '-' }
147
+ </ div >
148
+ </ li >
149
+ )
150
+ }
131
151
{
132
152
subTrackSummary . map ( ( { label, value, link } ) => (
133
153
< li key = { label } >
0 commit comments