mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
returning coin data based on coin symbol
This commit is contained in:
parent
f2835ac97a
commit
f8b0bb1bfa
@ -32,5 +32,12 @@ const WALLET_TOKENS = [{
|
||||
notCryptoToken:false
|
||||
}] as WalletTokenBase[]
|
||||
|
||||
export const COIN_SYMBOLS = {
|
||||
ECENCY:'Ecency',
|
||||
HIVE:'HIVE',
|
||||
HBD:'HBD',
|
||||
HP:'HP'
|
||||
}
|
||||
|
||||
|
||||
export default WALLET_TOKENS
|
@ -20,6 +20,7 @@ import { getEstimatedAmount } from '../utils/vote';
|
||||
|
||||
// Constants
|
||||
import ROUTES from '../constants/routeNames';
|
||||
import { COIN_SYMBOLS } from '../constants/walletTokens';
|
||||
|
||||
const HIVE_DROPDOWN = [
|
||||
'purchase_estm',
|
||||
@ -274,6 +275,26 @@ const WalletContainer = ({
|
||||
}
|
||||
};
|
||||
|
||||
//process symbol based data
|
||||
let balance = 0;
|
||||
let estimateValue = 0;
|
||||
let savings = 0;
|
||||
switch (coinSymbol) {
|
||||
case COIN_SYMBOLS.HIVE:
|
||||
balance = hiveBalance;
|
||||
estimateValue = estimatedHiveValue;
|
||||
savings = hiveSavingBalance;
|
||||
break;
|
||||
case COIN_SYMBOLS.HBD:
|
||||
balance = hbdBalance;
|
||||
estimateValue = estimatedHbdValue;
|
||||
savings = hbdSavingBalance;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
children &&
|
||||
children({
|
||||
@ -310,6 +331,11 @@ const WalletContainer = ({
|
||||
hivePowerDropdown: HIVE_POWER_DROPDOWN,
|
||||
unclaimedBalance: unclaimedBalance && unclaimedBalance.trim(),
|
||||
estimatedAmount,
|
||||
|
||||
//symbol based data
|
||||
balance,
|
||||
estimateValue,
|
||||
savings,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
@ -153,7 +153,7 @@ const WalletScreen = ({navigation}) => {
|
||||
|
||||
const _onPress = () => {
|
||||
navigation.navigate(ROUTES.SCREENS.COIN_DETAILS, {
|
||||
coinSymbol:item.tokenSymbol
|
||||
coinId:item.id
|
||||
} as CoinDetailsScreenParams)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user