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