Fixed wallet data

This commit is contained in:
mistikk 2018-11-10 14:07:43 +01:00
parent 668c4f756b
commit eefdc91d15
3 changed files with 23 additions and 15 deletions

View File

@ -44,9 +44,15 @@ class WalletView extends Component {
<MainButton style={styles.mainButton} height={50} onPress={this._handleOnPressLogin}>
<View style={styles.mainButtonWrapper}>
<Text style={styles.mainButtonText}>
{walletData.rewardSteemBalance ? `${walletData.rewardSteemBalance} STEEM` : ''}
{walletData.rewardSbdBalance ? ` ${walletData.rewardSbdBalance} SDB` : ''}
{walletData.rewardVestingSteem ? ` ${walletData.rewardVestingSteem} SP` : ''}
{walletData.rewardSteemBalance
? `${Math.round(walletData.rewardSteemBalance * 1000) / 1000} STEEM`
: ''}
{walletData.rewardSbdBalance
? ` ${Math.round(walletData.rewardSbdBalance * 1000) / 1000} SDB`
: ''}
{walletData.rewardVestingSteem
? ` ${Math.round(walletData.rewardVestingSteem * 1000) / 1000} SP`
: ''}
</Text>
<View style={styles.mainIconWrapper}>
<Ionicons name="md-add" color="#357ce6" size={23} />
@ -58,6 +64,8 @@ class WalletView extends Component {
<CollapsibleCard titleColor="#788187" title="Wallet Details" expanded>
<WalletDetails walletData={walletData} />
</CollapsibleCard>
<Transaction />
</ScrollView>
</View>
);

View File

@ -37,7 +37,7 @@ class WalletDetailsView extends Component {
text="Steem"
textColor="#3c4449"
iconName="ios-information-circle-outline"
rightText={`${walletData.estimatedValue} STEEM`}
rightText={`${Math.round(walletData.estimatedValue * 1000) / 1000} STEEM`}
isBoldText
/>
<GrayWrapper>
@ -45,33 +45,33 @@ class WalletDetailsView extends Component {
text="Steem Power"
textColor="#3c4449"
iconName="ios-information-circle-outline"
rightText={`${vestsToSp(walletData.vestingShares, walletData.steemPerMVests)} SP`}
rightText={`${Math.round(vestsToSp(walletData.vestingShares, walletData.steemPerMVests) * 1000) / 1000} SP`}
tightTextColor="red"
isBoldText
/>
{walletData.vestingSharesDelegated > 0 && (
<WalletLineItem
rightText={`- ${vestsToSp(
rightText={`- ${Math.round(vestsToSp(
walletData.vestingSharesDelegated,
walletData.steemPerMVests,
)} SP`}
) * 1000) / 1000} SP`}
/>
)}
{walletData.vestingSharesReceived > 0 && (
<WalletLineItem
rightText={`+ ${vestsToSp(
rightText={`+ ${Math.round(vestsToSp(
walletData.vestingSharesReceived,
walletData.steemPerMVests,
)} SP`}
) * 1000) / 1000} SP`}
/>
)}
{(walletData.vestingSharesDelegated > 0 || walletData.vestingSharesReceived > 0) && (
<WalletLineItem
rightText={`= ${vestsToSp(
rightText={`= ${Math.round(vestsToSp(
walletData.vestingSharesTotal,
walletData.steemPerMVests,
)} SP`}
) * 1000) / 1000} SP`}
rightTextColor="#357ce6"
/>
)}
@ -81,7 +81,7 @@ class WalletDetailsView extends Component {
text="Steem Dollars"
textColor="#3c4449"
iconName="ios-information-circle-outline"
rightText={`$${walletData.sbdBalance}`}
rightText={`$${Math.round(walletData.sbdBalance * 1000) / 1000}`}
isBoldText
/>
<GrayWrapper>
@ -89,10 +89,10 @@ class WalletDetailsView extends Component {
text="Savings"
textColor="#3c4449"
iconName="ios-information-circle-outline"
rightText={`${walletData.savingBalance} STEEM`}
rightText={`${Math.round(walletData.savingBalance * 1000) / 1000} STEEM`}
isBoldText
/>
<WalletLineItem rightText={`$${walletData.savingBalanceSbd}`} />
<WalletLineItem rightText={`$${Math.round(walletData.savingBalanceSbd * 1000) / 1000}`} />
</GrayWrapper>
</View>
);

View File

@ -148,7 +148,7 @@ class ProfileScreen extends Component {
)}
</View>
<View
tabLabel={user && user.balance ? `$${user && parseToken(user.balance)}` : 'Wallet'}
tabLabel="Wallet"
>
<Wallet user={user} />
</View>