mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
Display fiat value inside pool statistics (#610)
* fixed * replaced ddo.price with price from useAsset Co-authored-by: Norbi <katunanorbert@gmai.com>
This commit is contained in:
parent
cb8243f4cc
commit
9ce9fc84c7
@ -7,7 +7,7 @@ import { useAsset } from '../../../../providers/Asset'
|
||||
|
||||
export default function Transactions(): ReactElement {
|
||||
const [open, setOpen] = useState(false)
|
||||
const { ddo } = useAsset()
|
||||
const { price } = useAsset()
|
||||
function handleClick() {
|
||||
setOpen(!open)
|
||||
}
|
||||
@ -29,7 +29,7 @@ export default function Transactions(): ReactElement {
|
||||
</Button>
|
||||
</h3>
|
||||
{open === true && (
|
||||
<PoolTransactions poolAddress={ddo.price?.address} minimal />
|
||||
<PoolTransactions poolAddress={price?.address} minimal />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
@ -95,8 +95,8 @@ export default function Pool(): ReactElement {
|
||||
const [refreshPool, setRefreshPool] = useState(false)
|
||||
const { data: dataLiquidity } = useQuery<PoolLiquidity>(poolLiquidityQuery, {
|
||||
variables: {
|
||||
id: ddo.price.address.toLowerCase(),
|
||||
shareId: `${ddo.price.address.toLowerCase()}-${ddo.publicKey[0].owner.toLowerCase()}`
|
||||
id: price.address.toLowerCase(),
|
||||
shareId: `${price.address.toLowerCase()}-${ddo.publicKey[0].owner.toLowerCase()}`
|
||||
},
|
||||
pollInterval: 5000
|
||||
})
|
||||
@ -170,7 +170,8 @@ export default function Pool(): ReactElement {
|
||||
const totalUserLiquidityInOcean =
|
||||
userLiquidity?.ocean + userLiquidity?.datatoken * price?.value
|
||||
setTotalUserLiquidityInOcean(totalUserLiquidityInOcean)
|
||||
const totalLiquidityInOcean = price?.ocean + price?.datatoken * price?.value
|
||||
const totalLiquidityInOcean =
|
||||
Number(price?.ocean) + Number(price?.datatoken) * Number(price?.value)
|
||||
setTotalLiquidityInOcean(totalLiquidityInOcean)
|
||||
}, [userLiquidity, price, poolTokens, totalPoolTokens])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user