fix:display assets, income, vl
This commit is contained in:
parent
1c7443217b
commit
bc3c654c97
|
@ -29,9 +29,9 @@ import { useTranslation } from "react-i18next"
|
|||
|
||||
|
||||
export const Staking = () => {
|
||||
const [balance, setBalance] = React.useState({})
|
||||
const [balance, setBalance] = React.useState({}) // TODO: a reasonable default value must be given
|
||||
|
||||
const [coins, setCoins] = React.useState([])
|
||||
const [coins, setCoins] = React.useState([]) // TODO
|
||||
const [indexStrategy, setIndexStrategy] = React.useState(-1)
|
||||
const [indexCertificate, setIndexCertificate] = React.useState(-1)
|
||||
const [indexDeposite, setIndexDeposite] = React.useState(-1)
|
||||
|
@ -56,6 +56,7 @@ export const Staking = () => {
|
|||
|
||||
get_staking_balance(app.address).then((res) => {
|
||||
setBalance(res.data)
|
||||
console.log(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -298,7 +299,7 @@ export const Staking = () => {
|
|||
vl={coin.count_use}
|
||||
loading={coin.loading}
|
||||
authorized={coin.authorized}
|
||||
assets={0.00}
|
||||
assets={(coin.name == 'USDT' ? balance?.USDT : balance?.USDC) || 0.00}
|
||||
onStrategy={onStrategy}
|
||||
onCertificate={onCertificate}
|
||||
/>
|
||||
|
@ -318,7 +319,7 @@ export const Staking = () => {
|
|||
nodesStaked={coins[indexStrategy]?.count}
|
||||
nodesNominations={coins[indexStrategy]?.count}
|
||||
plans={coins[indexStrategy]?.conf.plans}
|
||||
share={0.58}
|
||||
share={(((balance?.USDT + balance?.USDC) || 0) / (coins[indexStrategy]?.count_use || coins[indexStrategy]?.count))?.toFixed(2) || 0.00}
|
||||
status='normal'
|
||||
/>
|
||||
|
||||
|
@ -329,8 +330,8 @@ export const Staking = () => {
|
|||
onConfirm={onConfirmCertificate}
|
||||
index={indexCertificate}
|
||||
coin={coins[indexCertificate]}
|
||||
assets={0.00}
|
||||
income={0.00}
|
||||
assets={(balance?.USDC + balance?.USDT) || 0}
|
||||
income={(balance?.USDC_T + + balance?.USDT_T) || 0}
|
||||
/>
|
||||
|
||||
<ModalRetrieve isOpen={isOpenExtract} onClose={onCloseExtract} onConfirm={onConfirmExtract} />
|
||||
|
|
|
@ -62,7 +62,7 @@ export const StakingModalStrategy = ({
|
|||
color="yellow.400"
|
||||
fontSize="14"
|
||||
>
|
||||
{t('nodeNominations')}
|
||||
{t('stakingNote')}
|
||||
</Text>
|
||||
</HStack>
|
||||
|
||||
|
|
Loading…
Reference in New Issue