mirror of
https://github.com/oceanprotocol/market.git
synced 2024-06-26 03:06:49 +02:00
* get poolShares dt addresses * style fixes * class names fix * remove useless changes * fix * try/catch blocks, loading fix * show pool shares fix * delete logs, fix build * more try/catch blocks * check subgraph url, add try/catch block * fixes * pool fields fix * minor code fixes * fix subgraph fetch Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove unused function, fixes * use LoggerInstance, remove useless setter * error messages fix, get rid of dt column * small tweaks and tests * fixes * fixes * modified flow for pool shares * loading UX fixes * unified calculations for pool liquidity * stop the refetch madness * profile provider already sets interval fetching for pool shares * pool shares will change when chainIds, accountId is changed so no need to listen for changes again * calculation tweaks * pool stats tweak * fix pool transactions * fix data display in pool shares section * minor fix, delete comment * subgraph typings generation fix * pool stats display tweaks * price sizing fix * rabbit hole fixes * more price UI fixes * cleanup * wording consistency * render all frontpage sections by default, load in assets after Co-authored-by: ClaudiaHolhos <claudia@oceanprotocol.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: mihaisc <mihai@oceanprotocol.com> Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
52 lines
986 B
TypeScript
52 lines
986 B
TypeScript
import React, { ReactElement } from 'react'
|
|
import PriceUnit from '@shared/Price/PriceUnit'
|
|
import styles from './UserLiquidity.module.css'
|
|
|
|
function UserLiquidityLine({
|
|
title,
|
|
amount,
|
|
symbol
|
|
}: {
|
|
title: string
|
|
amount: string
|
|
symbol: string
|
|
}) {
|
|
return (
|
|
<div>
|
|
<span>{title}</span>
|
|
<PriceUnit price={amount} symbol={symbol} size="small" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default function UserLiquidity({
|
|
amount,
|
|
symbol,
|
|
amountMax,
|
|
titleAvailable = 'Balance',
|
|
titleMaximum = 'Maximum'
|
|
}: {
|
|
amount: string
|
|
symbol: string
|
|
titleAvailable?: string
|
|
titleMaximum?: string
|
|
amountMax?: string
|
|
}): ReactElement {
|
|
return (
|
|
<div className={styles.userLiquidity}>
|
|
<UserLiquidityLine
|
|
title={titleAvailable}
|
|
amount={amount}
|
|
symbol={symbol}
|
|
/>
|
|
{amountMax && (
|
|
<UserLiquidityLine
|
|
title={titleMaximum}
|
|
amount={amountMax}
|
|
symbol={symbol}
|
|
/>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|