From e5ebaf02d2e03b0810539c7beb8906a83c102b95 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:40:08 -0400 Subject: [PATCH] fix(trading): ledger entries table formatting (#3180) --- 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; }} />