Skip to content

Commit cff1051

Browse files
authored
Merge pull request #3482 from topcoder-platform/issue_3465
Fix for Issue #3465
2 parents 7f07205 + 92b729e commit cff1051

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/shared/components/ProfilePage/Stats/index.jsx

+20
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import PT from 'prop-types';
88
import { Link } from 'react-router-dom';
99
import { getRatingColor } from 'utils/tc';
1010
import Th from 'assets/images/th.svg';
11+
import DefaultPortrait from 'assets/images/ico-user-default.svg';
1112
import {
1213
shouldShowGraph, getHistory, getSubTrackStats, getSummary, getDetails,
1314
} from 'utils/memberStats';
@@ -64,6 +65,8 @@ class ProfileStats extends React.Component {
6465
const subTrackStats = getSubTrackStats(stats, track, subTrack);
6566
const subTrackSummary = getSummary(stats, track, subTrack) || [];
6667
const subTrackDetails = getDetails(stats, track, subTrack) || [];
68+
const ratingObj = subTrackSummary.filter(k => k.label === 'rating');
69+
const subTrackRating = ratingObj ? ratingObj[0].value : 0;
6770

6871
if (track === 'DEVELOP') {
6972
const reliability = subTrackSummary.find(stat => stat.label === 'reliability');
@@ -128,6 +131,23 @@ Active Challenges
128131
}
129132
</ul>
130133
<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+
}
131151
{
132152
subTrackSummary.map(({ label, value, link }) => (
133153
<li key={label}>

src/shared/components/ProfilePage/Stats/styles.scss

+7
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@
196196
}
197197
}
198198

199+
img.profile-circle {
200+
border-radius: 50%;
201+
display: inline;
202+
width: 140px;
203+
height: 140px;
204+
}
205+
199206
& + .develop {
200207
// move the cards up to compensate for size. Refactor of the component will make this obsolete!
201208
margin-top: -40px;

0 commit comments

Comments
 (0)