diff --git a/components/Amount.tsx b/components/Amount.tsx index e184bd76d..fe528953c 100644 --- a/components/Amount.tsx +++ b/components/Amount.tsx @@ -32,7 +32,13 @@ interface AmountDisplayProps { space?: boolean; jumboText?: boolean; defaultTextSize?: boolean; - color?: 'text' | 'success' | 'warning' | 'highlight' | 'secondaryText'; + color?: + | 'text' + | 'success' + | 'warning' + | 'warningReserve' + | 'highlight' + | 'secondaryText'; colorOverride?: string; pending?: boolean; fee?: boolean; @@ -267,7 +273,13 @@ interface AmountProps { credit?: boolean; debit?: boolean; // If credit or debit doesn't cover the use case - color?: 'text' | 'success' | 'warning' | 'highlight' | 'secondaryText'; + color?: + | 'text' + | 'success' + | 'warning' + | 'warningReserve' + | 'highlight' + | 'secondaryText'; colorOverride?: string; toggleable?: boolean; pending?: boolean; diff --git a/components/BalanceSlider.tsx b/components/BalanceSlider.tsx index e7ffba726..55db625c5 100644 --- a/components/BalanceSlider.tsx +++ b/components/BalanceSlider.tsx @@ -5,6 +5,8 @@ import { ChannelItem } from '../components/Channels/ChannelItem'; interface BalanceSliderProps { localBalance: string | number; remoteBalance: string | number; + sendingCapacity: string | number; + receivingCapacity: string | number; localReserveBalance?: string | number; remoteReserveBalance?: string | number; list?: boolean; @@ -18,14 +20,18 @@ export default class BalanceSlider extends React.Component< const { localBalance, remoteBalance, + sendingCapacity, + receivingCapacity, localReserveBalance, remoteReserveBalance } = this.props; return ( } - {inbound && outbound && !(inbound == 0 && outbound == 0) && ( - - - - )} + {localBalance && + remoteBalance && + !(localBalance == 0 && remoteBalance == 0) && ( + + + + )} {!hideLabels && ( this.toggleItem(item)}> @@ -159,10 +162,13 @@ export default class ChannelPicker extends React.Component< this.toggleItem(item)}> diff --git a/components/LSPS1OrderResponse.tsx b/components/LSPS1OrderResponse.tsx index 46a8b0830..4b9b7ccfc 100644 --- a/components/LSPS1OrderResponse.tsx +++ b/components/LSPS1OrderResponse.tsx @@ -48,8 +48,8 @@ export default class LSPS1OrderResponse extends React.Component< { const channelRemoteBalance = new BigNumber( - channel.remoteBalance + channel.receivingCapacity ); const channelLocalBalance = new BigNumber( - channel.localBalance + channel.sendingCapacity ); const channelTotal = channelRemoteBalance.plus(channelLocalBalance); diff --git a/utils/ThemeUtils.ts b/utils/ThemeUtils.ts index 507c090ac..2a8b1120c 100644 --- a/utils/ThemeUtils.ts +++ b/utils/ThemeUtils.ts @@ -13,6 +13,7 @@ const Kyriaki: { [key: string]: any } = { inbound: '#FFF0CA', success: '#46BE43', warning: '#E14C4C', + warningReserve: '#EA8181', bitcoin: '#FFB040', delete: '#992600', bolt: '#FFF', @@ -43,6 +44,7 @@ const Light: { [key: string]: any } = { inbound: '#FFF0CA', success: '#46BE43', warning: '#E14C4C', + warningReserve: '#EA8181', bitcoin: '#FFB040', delete: '#cc3300', qrFrame: '#FFD93F', @@ -68,6 +70,7 @@ const Dark: { [key: string]: any } = { inboundReserve: '#636569', success: '#46BE43', warning: '#E14C4C', + warningReserve: '#EA8181', bitcoin: '#FFB040', delete: '#992600', qrFrame: '#FFD93F', diff --git a/views/Channels/Channel.tsx b/views/Channels/Channel.tsx index b067dae67..252d34c6c 100644 --- a/views/Channels/Channel.tsx +++ b/views/Channels/Channel.tsx @@ -231,8 +231,11 @@ export default class ChannelView extends React.Component< commit_weight, localBalance, remoteBalance, + sendingCapacity, + receivingCapacity, localReserveBalance, remoteReserveBalance, + isBelowReserve, commit_fee, csv_delay, total_satoshis_received, @@ -358,6 +361,8 @@ export default class ChannelView extends React.Component< {remotePubkey && this.renderContactLink(remotePubkey)} )} + {!!alias_scids && alias_scids.length > 0 && ( + 1 + ? localeString('views.Channel.aliasScids') + : localeString('views.Channel.aliasScid') + } + value={PrivacyUtils.sensitiveValue( + alias_scids.join(', ') + )} + /> + )} @@ -576,20 +593,27 @@ export default class ChannelView extends React.Component< /> )} + } - indicatorColor={themeColor('outbound')} /> } - indicatorColor={themeColor('inbound')} /> - {unsettled_balance && ( + {unsettled_balance !== '0' && ( )} - {!!alias_scids && alias_scids.length > 0 && ( - 1 - ? localeString('views.Channel.aliasScids') - : localeString('views.Channel.aliasScid') - } - value={PrivacyUtils.sensitiveValue( - alias_scids.join(', ') - )} - /> - )} + + } + indicatorColor={themeColor('outbound')} + /> + + } + indicatorColor={themeColor('inbound')} + /> {!!local_chan_reserve_sat && ( } infoText={localeString( diff --git a/views/Channels/ChannelsPane.tsx b/views/Channels/ChannelsPane.tsx index 863e8611d..7734530fd 100644 --- a/views/Channels/ChannelsPane.tsx +++ b/views/Channels/ChannelsPane.tsx @@ -119,9 +119,12 @@ export default class ChannelsPane extends React.PureComponent { title={item.displayName} status={getStatus()} pendingHTLCs={item?.pending_htlcs?.length > 0} - inbound={item.remoteBalance} - outbound={item.localBalance} + localBalance={item.localBalance} + remoteBalance={item.remoteBalance} + receivingCapacity={item.receivingCapacity} + sendingCapacity={item.sendingCapacity} largestTotal={largestChannelSats} + isBelowReserve={item.isBelowReserve} /> ); @@ -137,8 +140,10 @@ export default class ChannelsPane extends React.PureComponent { > 0} pendingTimelock={ @@ -146,6 +151,7 @@ export default class ChannelsPane extends React.PureComponent { ? forceCloseTimeLabel(item.blocks_til_maturity) : undefined } + isBelowReserve={item.isBelowReserve} /> );