feat: add quantum formatting for breakdown table with tooltip

This commit is contained in:
Matthew Russell
2023-06-12 16:55:29 -07:00
parent 274a090931
commit 868af49d08
2 changed files with 5 additions and 6 deletions
+3
View File
@@ -149,6 +149,7 @@ export const AccountTable = forwardRef<AgGridReact, AccountTableProps>(
'Currently allocated to a market as margin or bond. Check the breakdown for details.'
),
tooltipValueGetter: ({ value, data }) => {
if (!value || !data) return null;
return addDecimalsFormatNumber(value, data.asset.decimals);
},
onCellClicked: ({ data }) => {
@@ -197,6 +198,7 @@ export const AccountTable = forwardRef<AgGridReact, AccountTableProps>(
'Deposited on the network, but not allocated to a market. Free to use for placing orders or providing liquidity.'
),
tooltipValueGetter: ({ value, data }) => {
if (!value || !data) return null;
return addDecimalsFormatNumber(value, data.asset.decimals);
},
cellClass: ({ data }) => {
@@ -224,6 +226,7 @@ export const AccountTable = forwardRef<AgGridReact, AccountTableProps>(
'The total amount of each asset on this key. Includes used and available collateral.'
),
tooltipValueGetter: ({ value, data }) => {
if (!value || !data) return null;
return addDecimalsFormatNumber(value, data.asset.decimals);
},
valueFormatter: ({
+2 -6
View File
@@ -9,16 +9,12 @@ import type { AgGridReact, AgGridReactProps } from 'ag-grid-react';
import type { AccountFields } from './accounts-data-provider';
import { AccountTypeMapping } from '@vegaprotocol/types';
import type {
ValueProps,
VegaICellRendererParams,
VegaValueFormatterParams,
} from '@vegaprotocol/datagrid';
import {
ProgressBarCell,
progressBarCellRendererSelector,
} from '@vegaprotocol/datagrid';
import { ProgressBarCell } from '@vegaprotocol/datagrid';
import { AgGridLazy as AgGrid, PriceCell } from '@vegaprotocol/datagrid';
import type { ColDef, ValueFormatterParams } from 'ag-grid-community';
import type { ColDef } from 'ag-grid-community';
import { accountValuesComparator } from './accounts-table';
interface BreakdownTableProps extends AgGridReactProps {