1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

show BPT only in debug mode

This commit is contained in:
Matthias Kretschmann 2020-09-10 14:33:38 +02:00
parent 69afec8511
commit a8d8c95acb
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 9 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import Token from './Token'
import { Balance } from './'
import PriceUnit from '../../../atoms/Price/PriceUnit'
import Actions from './Actions'
import { useUserPreferences } from '../../../../providers/UserPreferences'
// TODO: handle and display all fees somehow
@ -22,6 +23,7 @@ export default function Add({
totalPoolTokens: string
totalBalance: Balance
}): ReactElement {
const { debug } = useUserPreferences()
const { ocean, accountId, balance } = useOcean()
const [amount, setAmount] = useState('')
const [swapFee, setSwapFee] = useState<string>()
@ -89,7 +91,7 @@ export default function Add({
<div className={styles.output}>
<div>
<p>You will receive</p>
<Token symbol="BPT" balance={newPoolTokens} />
{debug === true && <Token symbol="BPT" balance={newPoolTokens} />}
<Token symbol="% of pool" balance={newPoolShare} />
</div>
<div>

View File

@ -12,6 +12,7 @@ import Remove from './Remove'
import Tooltip from '../../../atoms/Tooltip'
import Conversion from '../../../atoms/Price/Conversion'
import EtherscanLink from '../../../atoms/EtherscanLink'
import { useUserPreferences } from '../../../../providers/UserPreferences'
export interface Balance {
ocean: string
@ -23,6 +24,7 @@ export interface Balance {
*/
export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
const { debug } = useUserPreferences()
const { ocean, accountId } = useOcean()
const { price, poolAddress } = useMetadata(ddo)
@ -149,7 +151,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
</h3>
<Token symbol="OCEAN" balance={userBalance.ocean} />
<Token symbol={dtSymbol} balance={userBalance.dt} />
<Token symbol="BPT" balance={poolTokens} />
{debug === true && <Token symbol="BPT" balance={poolTokens} />}
<Token symbol="% of pool" balance={poolShare} />
</div>
@ -157,7 +159,9 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
<h3 className={styles.title}>Pool Statistics</h3>
<Token symbol="OCEAN" balance={totalBalance.ocean} />
<Token symbol={dtSymbol} balance={totalBalance.dt} />
<Token symbol="BPT" balance={totalPoolTokens} />
{debug === true && (
<Token symbol="BPT" balance={totalPoolTokens} />
)}
</div>
</div>