mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
typing fixes
This commit is contained in:
parent
50accc0065
commit
4b0f7c0042
@ -26,8 +26,8 @@ export default function PoolStatistics({
|
||||
return (
|
||||
<div className={styles.statistics}>
|
||||
<h3 className={styles.title}>Pool Statistics</h3>
|
||||
<Token symbol="OCEAN" balance={totalBalance.ocean} />
|
||||
<Token symbol={dtSymbol} balance={totalBalance.datatoken} />
|
||||
<Token symbol="OCEAN" balance={`${totalBalance.ocean}`} />
|
||||
<Token symbol={dtSymbol} balance={`${totalBalance.datatoken}`} />
|
||||
{debug === true && <Token symbol="BPT" balance={totalPoolTokens} />}
|
||||
<Token symbol="% swap fee" balance={swapFee} />
|
||||
<Conversion price={`${totalLiquidityInOcean}`} />
|
||||
|
@ -50,7 +50,7 @@ export default function Remove({
|
||||
}
|
||||
|
||||
function handleMax() {
|
||||
setAmount(userLiquidity.ocean)
|
||||
setAmount(`${userLiquidity.ocean}`)
|
||||
}
|
||||
|
||||
return (
|
||||
@ -63,7 +63,7 @@ export default function Remove({
|
||||
<form className={styles.removeInput}>
|
||||
<div className={styles.userLiquidity}>
|
||||
<span>Your pool liquidity: </span>
|
||||
<PriceUnit price={userLiquidity.ocean} symbol="OCEAN" small />
|
||||
<PriceUnit price={`${userLiquidity.ocean}`} symbol="OCEAN" small />
|
||||
</div>
|
||||
<InputElement
|
||||
value={amount}
|
||||
@ -74,7 +74,7 @@ export default function Remove({
|
||||
onChange={handleAmountChange}
|
||||
/>
|
||||
|
||||
{userLiquidity.ocean > amount && (
|
||||
{userLiquidity.ocean > Number(amount) && (
|
||||
<Button
|
||||
className={styles.buttonMax}
|
||||
style="text"
|
||||
|
@ -16,8 +16,8 @@ import PoolStatistics from './PoolStatistics'
|
||||
import Token from './Token'
|
||||
|
||||
export interface Balance {
|
||||
ocean: string
|
||||
datatoken: string
|
||||
ocean: number
|
||||
datatoken: number
|
||||
}
|
||||
|
||||
/*
|
||||
@ -86,8 +86,8 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
Number(price.datatoken)
|
||||
|
||||
const userLiquidity = {
|
||||
ocean: `${userOceanBalance}`,
|
||||
datatoken: `${userDtBalance}`
|
||||
ocean: userOceanBalance,
|
||||
datatoken: userDtBalance
|
||||
}
|
||||
|
||||
setUserBalance(userLiquidity)
|
||||
@ -130,8 +130,8 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
<>
|
||||
<div className={styles.dataToken}>
|
||||
<PriceUnit price="1" symbol={dtSymbol} /> ={' '}
|
||||
<PriceUnit price={price.value} />
|
||||
<Conversion price={price.value} />
|
||||
<PriceUnit price={`${price.value}`} />
|
||||
<Conversion price={`${price.value}`} />
|
||||
<Tooltip content="Explain how this price is determined..." />
|
||||
<div className={styles.dataTokenLinks}>
|
||||
<EtherscanLink
|
||||
@ -152,14 +152,14 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
Your Liquidity
|
||||
<Tooltip content="Explain what this represents, advantage of providing liquidity..." />
|
||||
</h3>
|
||||
<Token symbol="OCEAN" balance={userLiquidity.ocean} />
|
||||
<Token symbol={dtSymbol} balance={userLiquidity.datatoken} />
|
||||
<Token symbol="OCEAN" balance={`${userLiquidity.ocean}`} />
|
||||
<Token symbol={dtSymbol} balance={`${userLiquidity.datatoken}`} />
|
||||
{debug === true && <Token symbol="BPT" balance={poolTokens} />}
|
||||
<Token symbol="% of pool" balance={poolShare} />
|
||||
</div>
|
||||
|
||||
<PoolStatistics
|
||||
price={price.value}
|
||||
price={`${price.value}`}
|
||||
totalPoolTokens={totalPoolTokens}
|
||||
totalBalance={{ ocean: price.ocean, datatoken: price.datatoken }}
|
||||
swapFee={swapFee}
|
||||
|
@ -21,11 +21,7 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
|
||||
useEffect(() => {
|
||||
if (!price || !price.value || !balance || !balance.ocean) return
|
||||
|
||||
const isFree = price.value === '0'
|
||||
|
||||
setIsBalanceSufficient(
|
||||
isFree ? true : compareAsBN(balance.ocean, price.value)
|
||||
)
|
||||
setIsBalanceSufficient(compareAsBN(balance.ocean, `${price.value}`))
|
||||
|
||||
return () => {
|
||||
setIsBalanceSufficient(false)
|
||||
|
Loading…
Reference in New Issue
Block a user