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) { if (beneficiary) {
beneficiary.forEach((key, index) => { beneficiary.forEach((key, index) => {
beneficiaries.push( 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

@ -89,16 +89,16 @@ export default EStyleSheet.create({
}, },
popoverItemContent: { popoverItemContent: {
flexDirection: 'row', flexDirection: 'row',
marginTop:4 marginTop: 4,
}, },
popoverContent: { popoverContent: {
marginTop: 4, marginTop: 4,
marginBottom:8 marginBottom: 8,
}, },
detailsLabel: { detailsLabel: {
width: 120, width: 120,
color: '$primaryDarkGray', color: '$primaryDarkGray',
fontSize: 12, fontSize: 12,
fontWeight: 'bold' fontWeight: 'bold',
}, },
}); });

View File

@ -266,16 +266,14 @@ class UpvoteView extends Component {
const _totalPayout = totalPayout || '0.000'; const _totalPayout = totalPayout || '0.000';
const sliderColor = downvote ? '#ec8b88' : '#357ce6'; const sliderColor = downvote ? '#ec8b88' : '#357ce6';
const _payoutPopupItem = (label, value) => { const _payoutPopupItem = (label, value) => {
return ( return (
<View style={styles.popoverItemContent}> <View style={styles.popoverItemContent}>
<Text style={styles.detailsLabel}>{label}</Text> <Text style={styles.detailsLabel}>{label}</Text>
<Text style={styles.detailsText}>{value}</Text> <Text style={styles.detailsText}>{value}</Text>
</View> </View>
) );
} };
return ( return (
<PopoverController> <PopoverController>
@ -341,46 +339,50 @@ class UpvoteView extends Component {
<View style={styles.popoverWrapper}> <View style={styles.popoverWrapper}>
{isShowDetails ? ( {isShowDetails ? (
<View style={styles.popoverContent}> <View style={styles.popoverContent}>
{promotedPayout > 0 && _payoutPopupItem( {promotedPayout > 0 &&
_payoutPopupItem(
intl.formatMessage({ id: 'payout.promoted' }), intl.formatMessage({ id: 'payout.promoted' }),
`${'~'}$${promotedPayout}` `${'~'}$${promotedPayout}`,
)} )}
{pendingPayout > 0 && _payoutPopupItem( {pendingPayout > 0 &&
_payoutPopupItem(
intl.formatMessage({ id: 'payout.potential_payout' }), intl.formatMessage({ id: 'payout.potential_payout' }),
`${'~'}$${pendingPayout}` `${'~'}$${pendingPayout}`,
)} )}
{authorPayout > 0 &&
{authorPayout > 0 && _payoutPopupItem( _payoutPopupItem(
intl.formatMessage({ id: 'payout.author_payout' }), intl.formatMessage({ id: 'payout.author_payout' }),
`${'~'}$${authorPayout}` `${'~'}$${authorPayout}`,
)} )}
{curationPayout > 0 && _payoutPopupItem( {_payoutPopupItem(
intl.formatMessage({ id: 'payout.curation_payout' }), intl.formatMessage({ id: 'payout.curation_payout' }),
`${'~'}$${curationPayout}` `${'~'}$${curationPayout}`,
)} )}
{breakdownPayout && pendingPayout > 0 && _payoutPopupItem( {breakdownPayout &&
pendingPayout > 0 &&
_payoutPopupItem(
intl.formatMessage({ id: 'payout.breakdown' }), intl.formatMessage({ id: 'payout.breakdown' }),
breakdownPayout breakdownPayout,
)} )}
{beneficiaries.length > 0 && _payoutPopupItem( {beneficiaries.length > 0 &&
_payoutPopupItem(
intl.formatMessage({ id: 'payout.beneficiaries' }), intl.formatMessage({ id: 'payout.beneficiaries' }),
beneficiaries beneficiaries,
)} )}
{!!payoutDate && _payoutPopupItem( {!!payoutDate &&
_payoutPopupItem(
intl.formatMessage({ id: 'payout.payout_date' }), intl.formatMessage({ id: 'payout.payout_date' }),
payoutDate payoutDate,
)} )}
{warnZeroPayout && _payoutPopupItem( {warnZeroPayout &&
intl.formatMessage({id: 'payout.warn_zero_payout'}), _payoutPopupItem(intl.formatMessage({ id: 'payout.warn_zero_payout' }), '')}
''
)}
</View> </View>
) : ( ) : (
<Fragment> <Fragment>