mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 11:51:52 +03:00
wip, pending payout details
This commit is contained in:
parent
bbeef9c9e2
commit
2d9cdfbfff
Binary file not shown.
@ -71,7 +71,20 @@ class UpvoteContainer extends PureComponent {
|
||||
? get(content, 'cashout_time')
|
||||
: get(content, 'last_payout'),
|
||||
);
|
||||
|
||||
const beneficiaries = [];
|
||||
const beneficiary = get(content, 'beneficiaries');
|
||||
if (beneficiaries) {
|
||||
beneficiary.forEach(key => {
|
||||
beneficiaries.push(
|
||||
get(key, 'account') + ': ' + (parseFloat(get(key, 'weight')) / 100).toFixed(2) + '%',
|
||||
);
|
||||
});
|
||||
}
|
||||
const minimumAmountForPayout = 0.02;
|
||||
let warnZeroPayout = false;
|
||||
if (pendingPayout > 0 && pendingPayout < minimumAmountForPayout) {
|
||||
warnZeroPayout = true;
|
||||
}
|
||||
return (
|
||||
<UpvoteView
|
||||
author={author}
|
||||
@ -93,6 +106,8 @@ class UpvoteContainer extends PureComponent {
|
||||
promotedPayout={promotedPayout}
|
||||
totalPayout={totalPayout}
|
||||
upvotePercent={upvotePercent}
|
||||
beneficiaries={beneficiaries}
|
||||
warnZeroPayout={warnZeroPayout}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -200,9 +200,11 @@ class UpvoteView extends Component {
|
||||
payoutDate,
|
||||
intl,
|
||||
isDownVoted,
|
||||
beneficiaries,
|
||||
warnZeroPayout,
|
||||
} = this.props;
|
||||
const { isVoting, amount, sliderValue, isVoted, isShowDetails, downvote } = this.state;
|
||||
|
||||
console.log('pendingPayout', pendingPayout);
|
||||
let iconName = 'upcircleo';
|
||||
const iconType = 'AntDesign';
|
||||
let downVoteIconName = 'downcircleo';
|
||||
@ -284,31 +286,53 @@ class UpvoteView extends Component {
|
||||
<View style={styles.popoverWrapper}>
|
||||
{isShowDetails ? (
|
||||
<View>
|
||||
{promotedPayout > 0 && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.promoted',
|
||||
})} ${promotedPayout > 0 ? '~' : ''}$${promotedPayout}`}
|
||||
})} ${'~'}$${promotedPayout}`}
|
||||
</Text>
|
||||
)}
|
||||
{pendingPayout > 0 && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.potential_payout',
|
||||
})} ${pendingPayout > 0 ? '~' : ''}$${pendingPayout}`}
|
||||
})} ${'~'}$${pendingPayout}`}
|
||||
</Text>
|
||||
)}
|
||||
{authorPayout > 0 && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.author_payout',
|
||||
})} ${authorPayout > 0 ? '~' : ''}$${authorPayout}`}
|
||||
})} ${'~'}$${authorPayout}`}
|
||||
</Text>
|
||||
)}
|
||||
{curationPayout > 0 && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.curation_payout',
|
||||
})} ${curationPayout > 0 ? '~' : ''}$${curationPayout}`}
|
||||
})} ${'~'}$${curationPayout}`}
|
||||
</Text>
|
||||
)}
|
||||
{beneficiaries.length > 0 && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.beneficiaries',
|
||||
})} ${beneficiaries}`}
|
||||
</Text>
|
||||
)}
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.payout_date',
|
||||
})} ${payoutDate}`}
|
||||
</Text>
|
||||
{warnZeroPayout && (
|
||||
<Text style={styles.detailsText}>
|
||||
{`${intl.formatMessage({
|
||||
id: 'payout.warn_zero_payout',
|
||||
})}`}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
) : (
|
||||
<Fragment>
|
||||
|
@ -319,7 +319,9 @@
|
||||
"promoted": "Promoted",
|
||||
"author_payout": "Author Payout",
|
||||
"curation_payout": "Curation Payout",
|
||||
"payout_date": "Payout"
|
||||
"payout_date": "Payout",
|
||||
"beneficiaries": "Beneficiaries",
|
||||
"warn_zero_payout": "Amount must reach $0.02 for payout"
|
||||
},
|
||||
"post_dropdown": {
|
||||
"copy": "copy link",
|
||||
|
Loading…
Reference in New Issue
Block a user