1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

output pool shares by default

This commit is contained in:
Matthias Kretschmann 2020-10-12 11:41:05 +02:00
parent c3c5ee6d0c
commit 753b5c2c9c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 15 additions and 16 deletions

View File

@ -9,7 +9,6 @@ import Token from './Token'
import { Balance } from './' import { Balance } from './'
import PriceUnit from '../../../atoms/Price/PriceUnit' import PriceUnit from '../../../atoms/Price/PriceUnit'
import Actions from './Actions' import Actions from './Actions'
import { useUserPreferences } from '../../../../providers/UserPreferences'
import Tooltip from '../../../atoms/Tooltip' import Tooltip from '../../../atoms/Tooltip'
import { ReactComponent as Caret } from '../../../../images/caret.svg' import { ReactComponent as Caret } from '../../../../images/caret.svg'
@ -30,7 +29,6 @@ export default function Add({
dtSymbol: string dtSymbol: string
dtAddress: string dtAddress: string
}): ReactElement { }): ReactElement {
const { debug } = useUserPreferences()
const { ocean, accountId, balance } = useOcean() const { ocean, accountId, balance } = useOcean()
const [amount, setAmount] = useState('') const [amount, setAmount] = useState('')
const [txId, setTxId] = useState<string>('') const [txId, setTxId] = useState<string>('')
@ -141,7 +139,7 @@ export default function Add({
<div className={styles.output}> <div className={styles.output}>
<div> <div>
<p>You will receive</p> <p>You will receive</p>
{debug === true && <Token symbol="BPT" balance={newPoolTokens} />} <Token symbol="pool shares" balance={newPoolTokens} />
<Token symbol="% of pool" balance={newPoolShare} /> <Token symbol="% of pool" balance={newPoolShare} />
</div> </div>
<div> <div>

View File

@ -1,4 +1,3 @@
import { useUserPreferences } from '../../../../providers/UserPreferences'
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import { Balance } from '.' import { Balance } from '.'
import styles from './PoolStatistics.module.css' import styles from './PoolStatistics.module.css'
@ -18,8 +17,6 @@ export default function PoolStatistics({
totalPoolTokens: string totalPoolTokens: string
swapFee: string swapFee: string
}): ReactElement { }): ReactElement {
const { debug } = useUserPreferences()
const totalLiquidityInOcean = const totalLiquidityInOcean =
totalBalance.ocean + totalBalance.datatoken * Number(price) totalBalance.ocean + totalBalance.datatoken * Number(price)
@ -28,12 +25,12 @@ export default function PoolStatistics({
<h3 className={styles.title}>Pool Statistics</h3> <h3 className={styles.title}>Pool Statistics</h3>
<Token symbol="OCEAN" balance={`${totalBalance.ocean}`} /> <Token symbol="OCEAN" balance={`${totalBalance.ocean}`} />
<Token symbol={dtSymbol} balance={`${totalBalance.datatoken}`} /> <Token symbol={dtSymbol} balance={`${totalBalance.datatoken}`} />
{debug === true && <Token symbol="BPT" balance={totalPoolTokens} />} <Token symbol="pool shares" balance={totalPoolTokens} noIcon />
<Token symbol="% swap fee" balance={swapFee} noIcon />
<Conversion <Conversion
price={`${totalLiquidityInOcean}`} price={`${totalLiquidityInOcean}`}
className={styles.totalLiquidity} className={styles.totalLiquidity}
/> />
<Token symbol="% swap fee" balance={swapFee} />
</div> </div>
) )
} }

View File

@ -30,7 +30,6 @@
fill: var(--brand-violet); fill: var(--brand-violet);
} }
.icon[class*='%'], .noIcon {
.icon[class*='BPT'] {
opacity: 0; opacity: 0;
} }

View File

@ -5,14 +5,18 @@ import PriceUnit from '../../../atoms/Price/PriceUnit'
export default function Token({ export default function Token({
symbol, symbol,
balance balance,
noIcon
}: { }: {
symbol: string symbol: string
balance: string balance: string
noIcon?: boolean
}): ReactElement { }): ReactElement {
return ( return (
<div className={styles.token}> <div className={styles.token}>
<figure className={`${styles.icon} ${symbol}`}> <figure
className={`${styles.icon} ${symbol} ${noIcon ? styles.noIcon : ''}`}
>
<Logo /> <Logo />
</figure> </figure>
<PriceUnit price={balance} symbol={symbol} small /> <PriceUnit price={balance} symbol={symbol} small />

View File

@ -38,6 +38,9 @@
font-weight: var(--font-weight-base) !important; font-weight: var(--font-weight-base) !important;
font-size: var(--font-size-small); font-size: var(--font-size-small);
padding-left: var(--font-size-base); padding-left: var(--font-size-base);
padding-top: calc(var(--spacer) / 3);
width: 100%;
border-top: 1px solid var(--brand-grey-lighter);
} }
.totalLiquidity strong { .totalLiquidity strong {

View File

@ -3,7 +3,6 @@ import { useOcean, useMetadata } from '@oceanprotocol/react'
import { DDO, Logger } from '@oceanprotocol/lib' import { DDO, Logger } from '@oceanprotocol/lib'
import styles from './index.module.css' import styles from './index.module.css'
import stylesActions from './Actions.module.css' import stylesActions from './Actions.module.css'
import { useUserPreferences } from '../../../../providers/UserPreferences'
import PriceUnit from '../../../atoms/Price/PriceUnit' import PriceUnit from '../../../atoms/Price/PriceUnit'
import Loader from '../../../atoms/Loader' import Loader from '../../../atoms/Loader'
import Button from '../../../atoms/Button' import Button from '../../../atoms/Button'
@ -25,7 +24,6 @@ export interface Balance {
*/ */
export default function Pool({ ddo }: { ddo: DDO }): ReactElement { export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
const { debug } = useUserPreferences()
const { ocean, accountId } = useOcean() const { ocean, accountId } = useOcean()
const { price } = useMetadata(ddo) const { price } = useMetadata(ddo)
@ -155,12 +153,12 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
</h3> </h3>
<Token symbol="OCEAN" balance={`${userLiquidity.ocean}`} /> <Token symbol="OCEAN" balance={`${userLiquidity.ocean}`} />
<Token symbol={dtSymbol} balance={`${userLiquidity.datatoken}`} /> <Token symbol={dtSymbol} balance={`${userLiquidity.datatoken}`} />
{debug === true && <Token symbol="BPT" balance={poolTokens} />} <Token symbol="pool shares" balance={poolTokens} noIcon />
<Token symbol="% of pool" balance={poolShare} noIcon />
<Conversion <Conversion
price={`${totalUserLiquidityInOcean}`} price={`${totalUserLiquidityInOcean}`}
className={styles.totalLiquidity} className={styles.totalLiquidity}
/> />
<Token symbol="% of pool" balance={poolShare} />
</div> </div>
<PoolStatistics <PoolStatistics