Skip to content

Commit

Permalink
chore: default channel columns
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed May 29, 2022
1 parent 815fd5b commit c95c16c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/client/src/views/channels/channels/ChannelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { chartColors } from '../../../styles/Themes';
import { getErrorContent } from '../../../utils/error';
import { blockToTime, formatSeconds, getPercent } from '../../../utils/helpers';
import { ChannelDetails } from './ChannelDetails';
import { defaultHiddenColumns } from './helpers';

const S = {
link: styled.span`
Expand Down Expand Up @@ -67,8 +68,8 @@ export const ChannelTable = () => {
});

const [hiddenColumns, setHiddenColumns] = useLocalStorage(
'hiddenColumns',
[] as string[]
'hiddenColumns-v2',
defaultHiddenColumns
);

const numberStringSorting = useCallback(
Expand Down Expand Up @@ -327,6 +328,7 @@ export const ChannelTable = () => {
{
Header: 'Channel Id',
accessor: 'id',
forceVisible: true,
Cell: ({ row }: any) => (
<div style={{ whiteSpace: 'nowrap' }}>
{getChannelLink(row.original.id)}
Expand Down Expand Up @@ -505,7 +507,7 @@ export const ChannelTable = () => {
},
],
},
{ Header: 'Details', accessor: 'viewAction', forceVisible: true },
{ Header: 'Details', accessor: 'viewAction' },
],
[numberStringSorting]
);
Expand Down
31 changes: 31 additions & 0 deletions src/client/src/views/channels/channels/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const defaultHiddenColumns = [
'channelPrivateLogo',
'channelOpenerLogo',
'channel_age',
'channel_age_duplicate',
'past_states',
'local_balance',
'remote_balance',
'balancePercentText',
'pending_total_amount',
'pending_total_tokens',
'pending_incoming_amount',
'pending_incoming_tokens',
'pending_outgoing_amount',
'pending_outgoing_tokens',
'time_offline',
'percentOnlineText',
'time_online',
'sent',
'received',
'activityPercentText',
'myBase',
'partnerBase',
'myMaxHtlc',
'myMinHtlc',
'partnerMaxHtlc',
'partnerMinHtlc',
'proportionalBars',
'activityBars',
'viewAction',
];

0 comments on commit c95c16c

Please sign in to comment.