Skip to content

Commit

Permalink
feat(ui): add activity metric
Browse files Browse the repository at this point in the history
resolve LN-Zap#1973
  • Loading branch information
korhaliv authored and mrfelton committed Jun 3, 2019
1 parent 32d6a2f commit c31c54d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion renderer/components/Channels/ChannelCardList.js
Expand Up @@ -20,7 +20,7 @@ const ChannelCardList = ({
}) => {
const ROW_PADDING_BOTTOM = 3
// current row height + margin bottom
const ROW_HEIGHT = 396 + baseSpace[ROW_PADDING_BOTTOM]
const ROW_HEIGHT = 446 + baseSpace[ROW_PADDING_BOTTOM]
const renderRow = rowProps => {
const { columnIndex, rowIndex, key, style } = rowProps
const index = rowIndex * 2 + columnIndex
Expand Down
10 changes: 9 additions & 1 deletion renderer/components/Channels/ChannelData.js
Expand Up @@ -22,6 +22,7 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest })
total_satoshis_sent,
total_satoshis_received,
csv_delay,
activity,
num_updates,
fundingTxTimestamp,
} = channel
Expand Down Expand Up @@ -77,6 +78,12 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest })
value: <Text>{num_updates}</Text>,
}),

activity: () => ({
label: <FormattedMessage {...messages.channel_activity} />,
body: <FormattedMessage {...messages.num_updates_description} />,
value: `${Math.round(activity * 100)}%`,
}),

csv_delay: () => ({
label: <FormattedMessage {...messages.csv_delay_label} />,
body: <FormattedMessage {...messages.csv_delay_description} />,
Expand Down Expand Up @@ -135,13 +142,14 @@ const ChannelData = ({ channel, currencyName, networkInfo, viewMode, ...rest })
// Determine which of the properties we will display based on the active view mode.
const candidateProps =
viewMode === CHANNEL_DATA_VIEW_MODE_BASIC
? ['channel_point', 'num_updates', 'csv_delay']
? ['channel_point', 'num_updates', 'csv_delay', 'activity']
: [
'channel_point',
'fundingTxTimestamp',
'closing_txid',
'num_updates',
'csv_delay',
'activity',
'total_satoshis_sent',
'total_satoshis_received',
'commit_fee',
Expand Down

0 comments on commit c31c54d

Please sign in to comment.