From f6f0e68fac39fd777835b0ae7f9d55ba651d95c9 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 14 Jun 2022 16:52:45 +0100 Subject: [PATCH] reorder delegation table columns --- .../components/Delegation/DelegationList.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nym-wallet/src/components/Delegation/DelegationList.tsx b/nym-wallet/src/components/Delegation/DelegationList.tsx index c7680cbb47..190ac95e2d 100644 --- a/nym-wallet/src/components/Delegation/DelegationList.tsx +++ b/nym-wallet/src/components/Delegation/DelegationList.tsx @@ -38,12 +38,12 @@ interface HeadCell { const headCells: HeadCell[] = [ { id: 'node_identity', label: 'Node ID', sortable: true, align: 'left' }, + { id: 'avg_uptime_percent', label: 'Uptime', sortable: true, align: 'center' }, + { id: 'profit_margin_percent', label: 'Profit margin', sortable: true, align: 'center' }, + { id: 'stake_saturation', label: 'Stake saturation', sortable: true, align: 'center' }, { id: 'delegated_on_iso_datetime', label: 'Delegated on', sortable: true, align: 'center' }, { id: 'amount', label: 'Delegation', sortable: true, align: 'center' }, { id: 'accumulated_rewards', label: 'Reward', sortable: true, align: 'center' }, - { id: 'profit_margin_percent', label: 'Profit margin', sortable: true, align: 'center' }, - { id: 'stake_saturation', label: 'Stake saturation', sortable: true, align: 'center' }, - { id: 'avg_uptime_percent', label: 'Uptime', sortable: true, align: 'center' }, ]; function descendingComparator(a: T, b: T, orderBy: keyof T) { @@ -154,6 +154,13 @@ export const DelegationList: React.FC<{ + {!item.avg_uptime_percent ? '-' : `${item.avg_uptime_percent}%`} + + {!item.profit_margin_percent ? '-' : `${item.profit_margin_percent}%`} + + + {!item.stake_saturation ? '-' : `${Math.round(item.stake_saturation * 100000) / 1000}%`} + {format(new Date(item.delegated_on_iso_datetime), 'dd/MM/yyyy')} {`${item.amount.amount} ${item.amount.denom}`} @@ -161,13 +168,7 @@ export const DelegationList: React.FC<{ ? '-' : `${item.accumulated_rewards.amount} ${item.accumulated_rewards.denom}`} - - {!item.profit_margin_percent ? '-' : `${item.profit_margin_percent}%`} - - - {!item.stake_saturation ? '-' : `${Math.round(item.stake_saturation * 100000) / 1000}%`} - - {!item.avg_uptime_percent ? '-' : `${item.avg_uptime_percent}%`} + {!item.pending_events.length ? (