From c4b847bd9637f3ebfc1f3fc301f2ad7ad2fc591d Mon Sep 17 00:00:00 2001 From: Madalina Raicu Date: Mon, 13 Mar 2023 18:35:30 +0000 Subject: [PATCH] fix(trading): ledger entries table formatting --- libs/ledger/src/lib/ledger-table.tsx | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/libs/ledger/src/lib/ledger-table.tsx b/libs/ledger/src/lib/ledger-table.tsx index 12e9a96c7..679f4dcbe 100644 --- a/libs/ledger/src/lib/ledger-table.tsx +++ b/libs/ledger/src/lib/ledger-table.tsx @@ -134,6 +134,10 @@ export const LedgerTable = forwardRef( headerName={t('Transfer type')} field="transferType" tooltipField="transferType" + filter={SetFilter} + filterParams={{ + set: TransferTypeMapping, + }} valueFormatter={({ value, }: VegaValueFormatterParams) => @@ -147,14 +151,9 @@ export const LedgerTable = forwardRef( value, data, }: VegaValueFormatterParams) => { - const marketDecimalPlaces = data?.marketSender?.decimalPlaces; const assetDecimalPlaces = data?.asset?.decimals || 0; return value - ? addDecimalsFormatNumber( - value, - assetDecimalPlaces, - marketDecimalPlaces - ) + ? addDecimalsFormatNumber(value, assetDecimalPlaces) : value; }} /> @@ -175,14 +174,9 @@ export const LedgerTable = forwardRef( value, data, }: VegaValueFormatterParams) => { - const marketDecimalPlaces = data?.marketSender?.decimalPlaces; const assetDecimalPlaces = data?.asset?.decimals || 0; return value - ? addDecimalsFormatNumber( - value, - assetDecimalPlaces, - marketDecimalPlaces - ) + ? addDecimalsFormatNumber(value, assetDecimalPlaces) : value; }} /> @@ -193,14 +187,9 @@ export const LedgerTable = forwardRef( value, data, }: VegaValueFormatterParams) => { - const marketDecimalPlaces = data?.marketReceiver?.decimalPlaces; const assetDecimalPlaces = data?.asset?.decimals || 0; return value - ? addDecimalsFormatNumber( - value, - assetDecimalPlaces, - marketDecimalPlaces - ) + ? addDecimalsFormatNumber(value, assetDecimalPlaces) : value; }} />