From 69520b87c8565a9667028b5884fe4cf5c6a7a756 Mon Sep 17 00:00:00 2001 From: Kacper Szarkiewicz Date: Thu, 26 Sep 2024 10:05:25 +0100 Subject: [PATCH] show Nabla Swap tooltips, change column names --- src/components/nabla/Pools/Swap/columns.tsx | 28 +++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/nabla/Pools/Swap/columns.tsx b/src/components/nabla/Pools/Swap/columns.tsx index df63adcc..04009295 100644 --- a/src/components/nabla/Pools/Swap/columns.tsx +++ b/src/components/nabla/Pools/Swap/columns.tsx @@ -1,5 +1,5 @@ import { CellContext, ColumnDef } from '@tanstack/react-table'; -import { Badge, Button } from 'react-daisyui'; +import { Badge, Button, Tooltip } from 'react-daisyui'; import { useModalToggle } from '../../../../services/modal'; import { rawToDecimal } from '../../../../shared/parseNumbers/metric'; import { NablaInstanceBackstopPool, NablaInstanceSwapPool } from '../../../../hooks/nabla/useNablaInstance'; @@ -14,15 +14,19 @@ export type SwapPoolColumn = NablaInstanceSwapPool & { const BIG_100 = new Big(100); -export const nameColumn: ColumnDef = { - header: 'Name', - accessorKey: 'name', - accessorFn: (row) => row.token?.name || '', +export const assetColumn: ColumnDef = { + header: 'Asset', + accessorKey: 'asset', + accessorFn: (row) => row.token?.symbol || '', enableSorting: true, } as const; export const liabilitiesColumn: ColumnDef = { - header: 'Pool liabilities', + header: () => ( + + Pool liabilities + + ), accessorKey: 'liabilities', accessorFn: (row) => rawToDecimal(row.totalLiabilities, row.lpTokenDecimals).toFixed(2, 0), enableSorting: true, @@ -32,7 +36,11 @@ export const liabilitiesColumn: ColumnDef = { } as const; export const reservesColumn: ColumnDef = { - header: 'Reserves', + header: () => ( + + Reserves + + ), accessorKey: 'reserves', accessorFn: (row) => rawToDecimal(row.reserve, row.token.decimals).toFixed(2, 0), enableSorting: true, @@ -46,7 +54,7 @@ export const aprColumn: ColumnDef = { accessorKey: 'apr', accessorFn: (row) => rawToDecimal(row.apr, row.token.decimals).mul(BIG_100).toFixed(2, 0), cell: (props): JSX.Element | null => ( - + {props.renderValue()}% ), @@ -115,11 +123,11 @@ export const actionsColumn: ColumnDef = { } as const; export const columnsWithMyAmount = [ - nameColumn, + assetColumn, liabilitiesColumn, reservesColumn, aprColumn, myAmountColumn, actionsColumn, ]; -export const columnsWithoutMyAmount = [nameColumn, liabilitiesColumn, reservesColumn, aprColumn, actionsColumn]; +export const columnsWithoutMyAmount = [assetColumn, liabilitiesColumn, reservesColumn, aprColumn, actionsColumn];