Skip to content

Commit 7114a47

Browse files
authored
feat(settings): add channel status for unusable (#2338)
1 parent b8bdf17 commit 7114a47

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/screens/Settings/Lightning/ChannelDetails.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ const ChannelDetails = ({
258258
<View style={styles.sectionTitle}>
259259
<Caption13Up color="secondary">{t('status')}</Caption13Up>
260260
</View>
261-
<ChannelStatus status={channel.status} order={blocktankOrder} />
261+
<ChannelStatus
262+
status={channel.status}
263+
order={blocktankOrder}
264+
isUsable={channel.is_usable}
265+
/>
262266
</View>
263267

264268
{order && (

src/screens/Settings/Lightning/ChannelStatus.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,29 @@ import {
2323

2424
const ChannelStatus = ({
2525
status,
26+
isUsable,
2627
order,
2728
}: {
2829
status: EChannelStatus;
30+
isUsable: boolean;
2931
order?: IBtOrder;
3032
}): ReactElement => {
3133
const { t } = useTranslation('lightning');
3234

3335
// Use open/closed status from LDK if available
3436
switch (status) {
3537
case EChannelStatus.open: {
38+
if (!isUsable) {
39+
return (
40+
<View style={styles.statusRow}>
41+
<ThemedView style={styles.statusIcon} color="yellow16">
42+
<LightningIcon color="yellow" width={16} height={16} />
43+
</ThemedView>
44+
<BodyMSB color="yellow">{t('order_state.inactive')}</BodyMSB>
45+
</View>
46+
);
47+
}
48+
3649
return (
3750
<View style={styles.statusRow}>
3851
<ThemedView style={styles.statusIcon} color="green16">

src/utils/i18n/locales/en/lightning.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@
563563
},
564564
"open": {
565565
"string": "Connection open"
566+
},
567+
"inactive": {
568+
"string": "Connection inactive"
566569
}
567570
},
568571
"wait_text_top": {

0 commit comments

Comments
 (0)