Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12769 from NejcZdovc/hotfix/#12217-contribution
Browse files Browse the repository at this point in the history
Fixes contribution pdf when having media publishers in
  • Loading branch information
bsclifton committed Jan 22, 2018
1 parent c68b3e7 commit 692f205
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/about/contributionStatement.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,13 @@ class ContributionStatement extends React.Component {
<tr className={css(styles.table__tr, styles.table__spacingRow)} />
{
page.map(function (row, idx) {
let publisherSynopsis = (this.synopsis.filter((entry) => { return entry.site === row[0] }) || [])[0] || {}
const publisherKey = row[0]
const publisherSynopsis = (this.synopsis.filter((entry) => { return entry.publisherKey === publisherKey }) || [])[0] || {}

let verified = publisherSynopsis.verified
let site = row[0]
let fractionStr = (parseFloat(row[2]) * 100).toFixed(2)
let fiatStr = row[3]
const verified = publisherSynopsis && publisherSynopsis.verified
const fractionStr = (parseFloat(row[2]) * 100).toFixed(2)
const fiatStr = row[3]
const title = (publisherSynopsis && publisherSynopsis.siteName) ? publisherSynopsis.siteName : publisherKey

return (
<tr className={css(styles.textAlignRight, styles.table__tr)}>
Expand All @@ -340,7 +341,7 @@ class ContributionStatement extends React.Component {
styles.table__siteColumn)}
data-test-id='siteColumnTr'>
{verified ? <span className={css(imgStyle.verified, styles.table__verified)} /> : null}
<span className={verified ? css(styles.table__verifiedSite) : site}>{site}</span>
<span className={verified ? css(styles.table__verifiedSite) : false}>{title}</span>
</td>
<td className='fractionColumn'>{fractionStr}</td>
<td className='fiatColumn'>{fiatStr}</td>
Expand Down

0 comments on commit 692f205

Please sign in to comment.