diff --git a/src/shared/components/ProfilePage/Stats/index.jsx b/src/shared/components/ProfilePage/Stats/index.jsx index 96432981dd..d06275fd96 100644 --- a/src/shared/components/ProfilePage/Stats/index.jsx +++ b/src/shared/components/ProfilePage/Stats/index.jsx @@ -8,6 +8,8 @@ import PT from 'prop-types'; import { Link } from 'react-router-dom'; import { getRatingColor } from 'utils/tc'; import Th from 'assets/images/th.svg'; +import DefaultPortrait from 'assets/images/ico-user-default.svg'; +import LeftArrow from 'assets/images/arrow-prev.svg'; import { shouldShowGraph, getHistory, getSubTrackStats, getSummary, getDetails, } from 'utils/memberStats'; @@ -64,6 +66,11 @@ class ProfileStats extends React.Component { const subTrackStats = getSubTrackStats(stats, track, subTrack); const subTrackSummary = getSummary(stats, track, subTrack) || []; const subTrackDetails = getDetails(stats, track, subTrack) || []; + const ratingObj = subTrackSummary.filter(k => k.label === 'rating'); + let subTrackRating = ratingObj && ratingObj[0] ? ratingObj[0].value : 0; + if (subTrackRating === 0 || !subTrackRating) { // if subtrack has no rating, pick default rating + subTrackRating = info.maxRating ? info.maxRating.rating : 0; + } if (track === 'DEVELOP') { const reliability = subTrackSummary.find(stat => stat.label === 'reliability'); @@ -85,6 +92,10 @@ class ProfileStats extends React.Component {