diff --git a/src/components/upvote/container/upvoteContainer.js b/src/components/upvote/container/upvoteContainer.js index 46b11d1cb..3f2fe55ef 100644 --- a/src/components/upvote/container/upvoteContainer.js +++ b/src/components/upvote/container/upvoteContainer.js @@ -136,7 +136,9 @@ const UpvoteContainer = (props) => { if (beneficiary) { beneficiary.forEach((key, index) => { beneficiaries.push( - `${index !== 0?'\n':''}${get(key, 'account')}: ${(parseFloat(get(key, 'weight')) / 100).toFixed(2)}%`, + `${index !== 0 ? '\n' : ''}${get(key, 'account')}: ${( + parseFloat(get(key, 'weight')) / 100 + ).toFixed(2)}%`, ); }); } diff --git a/src/components/upvote/view/upvoteStyles.js b/src/components/upvote/view/upvoteStyles.js index 3f883d998..58a258552 100644 --- a/src/components/upvote/view/upvoteStyles.js +++ b/src/components/upvote/view/upvoteStyles.js @@ -88,17 +88,17 @@ export default EStyleSheet.create({ fontSize: 12, }, popoverItemContent: { - flexDirection:'row', - marginTop:4 + flexDirection: 'row', + marginTop: 4, }, - popoverContent:{ - marginTop:4, - marginBottom:8 + popoverContent: { + marginTop: 4, + marginBottom: 8, }, detailsLabel: { - width:120, + width: 120, color: '$primaryDarkGray', fontSize: 12, - fontWeight: 'bold' + fontWeight: 'bold', }, }); diff --git a/src/components/upvote/view/upvoteView.js b/src/components/upvote/view/upvoteView.js index fa2d6545d..a8652c97e 100644 --- a/src/components/upvote/view/upvoteView.js +++ b/src/components/upvote/view/upvoteView.js @@ -266,16 +266,14 @@ class UpvoteView extends Component { const _totalPayout = totalPayout || '0.000'; const sliderColor = downvote ? '#ec8b88' : '#357ce6'; - const _payoutPopupItem = (label, value) => { - return ( - - {label} - {value} - - ) - } - + return ( + + {label} + {value} + + ); + }; return ( @@ -341,46 +339,50 @@ class UpvoteView extends Component { {isShowDetails ? ( - {promotedPayout > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.promoted'}), - `${'~'}$${promotedPayout}` + {promotedPayout > 0 && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.promoted' }), + `${'~'}$${promotedPayout}`, + )} + + {pendingPayout > 0 && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.potential_payout' }), + `${'~'}$${pendingPayout}`, + )} + + {authorPayout > 0 && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.author_payout' }), + `${'~'}$${authorPayout}`, + )} + + {_payoutPopupItem( + intl.formatMessage({ id: 'payout.curation_payout' }), + `${'~'}$${curationPayout}`, )} - {pendingPayout > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.potential_payout'}), - `${'~'}$${pendingPayout}` - )} + {breakdownPayout && + pendingPayout > 0 && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.breakdown' }), + breakdownPayout, + )} + {beneficiaries.length > 0 && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.beneficiaries' }), + beneficiaries, + )} - {authorPayout > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.author_payout'}), - `${'~'}$${authorPayout}` - )} - - {curationPayout > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.curation_payout'}), - `${'~'}$${curationPayout}` - )} + {!!payoutDate && + _payoutPopupItem( + intl.formatMessage({ id: 'payout.payout_date' }), + payoutDate, + )} - {breakdownPayout && pendingPayout > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.breakdown'}), - breakdownPayout - )} - - {beneficiaries.length > 0 && _payoutPopupItem( - intl.formatMessage({id: 'payout.beneficiaries'}), - beneficiaries - )} - - {!!payoutDate && _payoutPopupItem( - intl.formatMessage({id: 'payout.payout_date'}), - payoutDate - )} - - {warnZeroPayout && _payoutPopupItem( - intl.formatMessage({id: 'payout.warn_zero_payout'}), - '' - )} + {warnZeroPayout && + _payoutPopupItem(intl.formatMessage({ id: 'payout.warn_zero_payout' }), '')} ) : (