This commit is contained in:
Nouman Tahir 2021-06-10 14:27:34 +05:00
parent 9cff698438
commit 2307ed827c
3 changed files with 56 additions and 52 deletions

View File

@ -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)}%`,
);
});
}

View File

@ -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',
},
});

View File

@ -266,16 +266,14 @@ class UpvoteView extends Component {
const _totalPayout = totalPayout || '0.000';
const sliderColor = downvote ? '#ec8b88' : '#357ce6';
const _payoutPopupItem = (label, value) => {
return (
<View style={styles.popoverItemContent} >
<Text style={styles.detailsLabel}>{label}</Text>
<Text style={styles.detailsText}>{value}</Text>
</View>
)
}
return (
<View style={styles.popoverItemContent}>
<Text style={styles.detailsLabel}>{label}</Text>
<Text style={styles.detailsText}>{value}</Text>
</View>
);
};
return (
<PopoverController>
@ -341,46 +339,50 @@ class UpvoteView extends Component {
<View style={styles.popoverWrapper}>
{isShowDetails ? (
<View style={styles.popoverContent}>
{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' }), '')}
</View>
) : (
<Fragment>