fix(ui-toolkit): healthbar fee decimals (#4152)
This commit is contained in:
parent
df88e77cdf
commit
180de8cf25
@ -1,4 +1,4 @@
|
||||
{
|
||||
"name": "@vegaprotocol/ui-toolkit",
|
||||
"version": "0.12.3"
|
||||
"version": "0.12.4"
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
import classNames from 'classnames';
|
||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||
import {
|
||||
addDecimalsFormatNumber,
|
||||
formatNumberPercentage,
|
||||
} from '@vegaprotocol/utils';
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { getIntentBackground, Intent } from '../../utils/intent';
|
||||
@ -74,13 +77,17 @@ const Level = ({
|
||||
.multipliedBy(100)
|
||||
.toNumber();
|
||||
|
||||
const formattedFee = fee
|
||||
? formatNumberPercentage(new BigNumber(fee).times(100), 2)
|
||||
: '-';
|
||||
|
||||
const tooltipContent = (
|
||||
<>
|
||||
<div className="mt-1.5 inline-flex">
|
||||
<Indicator variant={intent} />
|
||||
</div>
|
||||
<span>
|
||||
{fee}% {t('Fee')}
|
||||
{formattedFee}% {t('Fee')}
|
||||
</span>
|
||||
<div className="flex flex-col">
|
||||
<span>
|
||||
@ -179,7 +186,7 @@ export const HealthBar = ({
|
||||
opacity={opacity}
|
||||
fee={fee}
|
||||
prevLevel={prevLevel}
|
||||
decimals={0}
|
||||
decimals={decimals}
|
||||
intent={intent}
|
||||
key={'healthbar-segment-' + index}
|
||||
/>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@vegaprotocol/utils",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user