mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
fix estimated sp value, show delegations
This commit is contained in:
parent
6e6428d3d6
commit
f4ec281b52
@ -19,6 +19,7 @@
|
|||||||
"outgoing_transfer_title": "Outgoing transfer",
|
"outgoing_transfer_title": "Outgoing transfer",
|
||||||
"checkin_extra": "Bonus",
|
"checkin_extra": "Bonus",
|
||||||
"delegation": "Delegation",
|
"delegation": "Delegation",
|
||||||
|
"delegations": "Delegations",
|
||||||
"delegation_title": "Delegation reward",
|
"delegation_title": "Delegation reward",
|
||||||
"delegation_desc": "Earn ESTM everyday for delegation",
|
"delegation_desc": "Earn ESTM everyday for delegation",
|
||||||
"post_title": "Points for post",
|
"post_title": "Points for post",
|
||||||
|
@ -55,6 +55,7 @@ const WalletContainer = ({
|
|||||||
const [estimatedSpValue, setEstimatedSpValue] = useState(0);
|
const [estimatedSpValue, setEstimatedSpValue] = useState(0);
|
||||||
const [unclaimedBalance, setUnclaimedBalance] = useState('');
|
const [unclaimedBalance, setUnclaimedBalance] = useState('');
|
||||||
const [estimatedAmount, setEstimatedAmount] = useState(0);
|
const [estimatedAmount, setEstimatedAmount] = useState(0);
|
||||||
|
const [delegationsAmount, setDelegationsAmount] = useState(0);
|
||||||
const [transferHistory, setTransferHistory] = useState([]);
|
const [transferHistory, setTransferHistory] = useState([]);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -143,6 +144,13 @@ const WalletContainer = ({
|
|||||||
setEstimatedSbdValue && setEstimatedSbdValue(_walletData.estimatedSbdValue);
|
setEstimatedSbdValue && setEstimatedSbdValue(_walletData.estimatedSbdValue);
|
||||||
setEstimatedSteemValue && setEstimatedSteemValue(_walletData.estimatedSteemValue);
|
setEstimatedSteemValue && setEstimatedSteemValue(_walletData.estimatedSteemValue);
|
||||||
setEstimatedSpValue && setEstimatedSpValue(_walletData.estimatedSpValue);
|
setEstimatedSpValue && setEstimatedSpValue(_walletData.estimatedSpValue);
|
||||||
|
setDelegationsAmount &&
|
||||||
|
setDelegationsAmount(
|
||||||
|
vestsToSp(
|
||||||
|
_walletData.vestingSharesReceived - _walletData.vestingSharesDelegated,
|
||||||
|
steemPerMVests,
|
||||||
|
).toFixed(3),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
[globalProps, intl.formatNumber, setEstimatedWalletValue, steemPerMVests],
|
[globalProps, intl.formatNumber, setEstimatedWalletValue, steemPerMVests],
|
||||||
);
|
);
|
||||||
@ -282,6 +290,7 @@ const WalletContainer = ({
|
|||||||
estimatedSteemValue,
|
estimatedSteemValue,
|
||||||
estimatedSbdValue,
|
estimatedSbdValue,
|
||||||
estimatedSpValue,
|
estimatedSpValue,
|
||||||
|
delegationsAmount,
|
||||||
navigate: _navigate,
|
navigate: _navigate,
|
||||||
steemDropdown: STEEM_DROPDOWN,
|
steemDropdown: STEEM_DROPDOWN,
|
||||||
sbdDropdown: SBD_DROPDOWN,
|
sbdDropdown: SBD_DROPDOWN,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View, Text } from 'react-native';
|
||||||
|
|
||||||
import { WalletHeader, FormattedCurrency } from '../../../components';
|
import { WalletHeader, FormattedCurrency } from '../../../components';
|
||||||
import { SteemWalletContainer, AccountContainer } from '../../../containers';
|
import { SteemWalletContainer, AccountContainer } from '../../../containers';
|
||||||
@ -20,6 +20,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) =
|
|||||||
spBalance,
|
spBalance,
|
||||||
isLoading,
|
isLoading,
|
||||||
estimatedSpValue,
|
estimatedSpValue,
|
||||||
|
delegationsAmount,
|
||||||
steemPowerDropdown,
|
steemPowerDropdown,
|
||||||
unclaimedBalance,
|
unclaimedBalance,
|
||||||
navigate,
|
navigate,
|
||||||
@ -45,6 +46,15 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) =
|
|||||||
currentIndex={currentIndex}
|
currentIndex={currentIndex}
|
||||||
showIconList={false}
|
showIconList={false}
|
||||||
valueDescriptions={[
|
valueDescriptions={[
|
||||||
|
{
|
||||||
|
textKey: 'delegations',
|
||||||
|
value: (
|
||||||
|
<Text>
|
||||||
|
{delegationsAmount}
|
||||||
|
{' SP'}
|
||||||
|
</Text>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
textKey: 'estimated_value',
|
textKey: 'estimated_value',
|
||||||
value: <FormattedCurrency isApproximate isToken value={estimatedSpValue} />,
|
value: <FormattedCurrency isApproximate isToken value={estimatedSpValue} />,
|
||||||
|
@ -187,7 +187,7 @@ export const groomingWalletData = async (user, globalProps, userCurrency) => {
|
|||||||
walletData.vestingSharesReceived = parseToken(user.received_vesting_shares);
|
walletData.vestingSharesReceived = parseToken(user.received_vesting_shares);
|
||||||
walletData.vestingSharesTotal =
|
walletData.vestingSharesTotal =
|
||||||
walletData.vestingShares - walletData.vestingSharesDelegated + walletData.vestingSharesReceived;
|
walletData.vestingShares - walletData.vestingSharesDelegated + walletData.vestingSharesReceived;
|
||||||
|
walletData.vestingSharesOwned = walletData.vestingShares - walletData.vestingSharesDelegated;
|
||||||
walletData.sbdBalance = parseToken(user.sbd_balance);
|
walletData.sbdBalance = parseToken(user.sbd_balance);
|
||||||
walletData.savingBalance = parseToken(user.savings_balance);
|
walletData.savingBalance = parseToken(user.savings_balance);
|
||||||
walletData.savingBalanceSbd = parseToken(user.savings_sbd_balance);
|
walletData.savingBalanceSbd = parseToken(user.savings_sbd_balance);
|
||||||
@ -215,7 +215,7 @@ export const groomingWalletData = async (user, globalProps, userCurrency) => {
|
|||||||
walletData.estimatedSteemValue = (walletData.balance + walletData.savingBalance) * ppSteem;
|
walletData.estimatedSteemValue = (walletData.balance + walletData.savingBalance) * ppSteem;
|
||||||
walletData.estimatedSbdValue = totalSbd * ppSbd;
|
walletData.estimatedSbdValue = totalSbd * ppSbd;
|
||||||
walletData.estimatedSpValue =
|
walletData.estimatedSpValue =
|
||||||
vestsToSp(walletData.vestingSharesTotal, walletData.steemPerMVests) * ppSteem;
|
vestsToSp(walletData.vestingSharesOwned, walletData.steemPerMVests) * ppSteem;
|
||||||
|
|
||||||
walletData.showPowerDown = user.next_vesting_withdrawal !== '1969-12-31T23:59:59';
|
walletData.showPowerDown = user.next_vesting_withdrawal !== '1969-12-31T23:59:59';
|
||||||
const timeDiff = Math.abs(parseDate(user.next_vesting_withdrawal) - new Date());
|
const timeDiff = Math.abs(parseDate(user.next_vesting_withdrawal) - new Date());
|
||||||
|
Loading…
Reference in New Issue
Block a user