fix: format last price and shrink 0 on warning icon

This commit is contained in:
madalinaraicu 2022-07-15 14:53:12 +02:00
parent edfb0a4e37
commit 21d14c5e0b
3 changed files with 11 additions and 4 deletions

View File

@ -4,7 +4,11 @@ import {
VegaWalletOrderType,
VegaWalletOrderTimeInForce,
} from '@vegaprotocol/wallet';
import { t, addDecimal, toDecimal } from '@vegaprotocol/react-helpers';
import {
t,
toDecimal,
addDecimalsFormatNumber,
} from '@vegaprotocol/react-helpers';
import { Button, InputError } from '@vegaprotocol/ui-toolkit';
import { TypeSelector } from './type-selector';
import { SideSelector } from './side-selector';
@ -83,7 +87,10 @@ export const DealTicket = ({
register={register}
price={
market.depth.lastTrade
? addDecimal(market.depth.lastTrade.price, market.decimalPlaces)
? addDecimalsFormatNumber(
market.depth.lastTrade.price,
market.decimalPlaces
)
: undefined
}
quoteName={market.tradableInstrument.instrument.product.quoteName}

View File

@ -17,6 +17,7 @@ export const Icon = ({ size = 16, name, className, ariaLabel }: IconProps) => {
'fill-current',
'align-text-bottom',
'fill-current',
'shrink-0',
{
'w-20': size === 20,
'h-20': size === 20,

View File

@ -21,7 +21,6 @@ export const InputError = ({
'flex',
'items-center',
'box-border',
'h-28',
'border-l-4',
'text-black-95 dark:text-white-95',
'text-ui',
@ -44,7 +43,7 @@ export const InputError = ({
{...props}
role="alert"
>
<Icon name="warning-sign" className={iconClassName} />
<Icon name="warning-sign" size={16} className={iconClassName} />
{children}
</div>
);