Skip to content

Commit 69a6bcd

Browse files
fix default image
1 parent 85b8222 commit 69a6bcd

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed
3.16 KB
Loading

src/shared/components/challenge-detail/MMDashboard/Graph/index.jsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,11 @@ import HighchartsReact from 'highcharts-react-official';
55
import PT from 'prop-types';
66
import moment from 'moment';
77
import { getRatingColor } from 'utils/tc';
8-
import ReactSVG from 'react-svg';
9-
import { isomorphy } from 'topcoder-react-utils';
8+
import DefaultUserImage from 'assets/images/ico-user-default.png';
109

1110
import './styles.scss';
1211
import _ from 'lodash';
1312

14-
15-
let assets;
16-
if (isomorphy.isClientSide()) {
17-
assets = require.context('assets/images', false, /svg/);
18-
}
19-
2013
export default function Graph({ statisticsData, baseline, awardLine }) {
2114
const flatData = [];
2215
const dates = [];
@@ -112,10 +105,7 @@ export default function Graph({ statisticsData, baseline, awardLine }) {
112105
formatter() {
113106
const str = `
114107
<div style="border-radius:4px;">
115-
${this.point.customData.photoUrl
116-
? `<img height="30" width="30" src="${this.point.customData.photoUrl}" style="position: absolute; border-radius: 50%;" />`
117-
: <ReactSVG path={assets('./ico-user-default.svg')} />}
118-
108+
<img height="30" width="30" src="${this.point.customData.photoUrl || DefaultUserImage}" style="position: absolute; border-radius: 50%;" />
119109
<p style="margin-left: 50px">${this.point.customData.handle}</p>
120110
<br />
121111
<p style="margin-left: 50px;">${this.point.customData.submissionCount} submissions</p>

0 commit comments

Comments
 (0)