mars-v2-frontend/src/components/AmountAndValue.tsx
Linkie Link 184a27e987
MP-2891 and MP-2801 (#321)
* MP-2801: fund new credit account

* tidy: cleanup

* tidy: refactor

* feat: replaced all possible BN(0) & BN(1) occurrences with constants

* fix: adjusted according to feedback

* fix: adjustments according to feedback

* fix: PR comment updates

* fix: reduced complexity

* feat: animated the wallet balance for the demo

* fix: enhanced wallet connection to select first account

* fix: adjusted the calculations and added USD as displayCurrency

* fix: adjusted according to feedback

* feat: added TFM bridge

* fix: changed forceFetchPrice

---------

Co-authored-by: Yusuf Seyrek <yusuf@delphilabs.io>
2023-07-27 11:26:32 +02:00

25 lines
682 B
TypeScript

import DisplayCurrency from 'components/DisplayCurrency'
import { FormattedNumber } from 'components/FormattedNumber'
import { BNCoin } from 'types/classes/BNCoin'
interface Props {
asset: Asset
amount: BigNumber
}
export default function AmountAndValue(props: Props) {
return (
<div className='flex flex-col gap-[0.5] text-xs'>
<FormattedNumber
amount={props.amount.toNumber()}
options={{ decimals: props.asset.decimals, abbreviated: true }}
animate
/>
<DisplayCurrency
className='justify-end text-xs text-white/50'
coin={BNCoin.fromDenomAndBigNumber(props.asset.denom, props.amount)}
/>
</div>
)
}