Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit f0dea53

Browse files
Merge pull request #1047 from lightninglabs/hide-channel-close-btn
Hide channel close btn
2 parents 415e00c + 6ea6576 commit f0dea53

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

src/view/channel-detail-mobile.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,29 @@ const ChannelDetailView = ({ store, nav }) => (
4848
<DetailField name="Status">
4949
{store.selectedChannel.statusLabel}
5050
</DetailField>
51+
{store.selectedChannel.timeTilAvailable ? (
52+
<DetailField name="Time Til Available">
53+
{store.selectedChannel.timeTilAvailable}
54+
</DetailField>
55+
) : null}
5156
<DetailField name="Capacity">
5257
{store.selectedChannel.capacityLabel} {store.unitLabel}
5358
</DetailField>
5459
<DetailField name="Balance">
5560
{store.selectedChannel.localBalanceLabel} {store.unitLabel}
5661
</DetailField>
57-
<View style={styles.btnWrapper}>
58-
<Button
59-
style={styles.deleteBtn}
60-
onPress={() => nav.goChannelDelete()}
61-
>
62-
<ButtonText style={styles.deleteBtnText}>CLOSE CHANNEL</ButtonText>
63-
</Button>
64-
</View>
62+
{!/close|closing/i.test(store.selectedChannel.status) ? (
63+
<View style={styles.btnWrapper}>
64+
<Button
65+
style={styles.deleteBtn}
66+
onPress={() => nav.goChannelDelete()}
67+
>
68+
<ButtonText style={styles.deleteBtnText}>
69+
CLOSE CHANNEL
70+
</ButtonText>
71+
</Button>
72+
</View>
73+
) : null}
6574
</Card>
6675
</MainContent>
6776
</SplitBackground>

src/view/channel-detail.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { StyleSheet } from 'react-native';
2+
import { View, StyleSheet } from 'react-native';
33
import { observer } from 'mobx-react';
44
import PropTypes from 'prop-types';
55
import Background from '../component/background';
@@ -24,6 +24,9 @@ const styles = StyleSheet.create({
2424
color: color.pinkSig,
2525
fontSize: font.sizeS,
2626
},
27+
bottomPadding: {
28+
paddingBottom: 30,
29+
},
2730
});
2831

2932
const ChannelDetailView = ({ store, nav }) => (
@@ -59,9 +62,16 @@ const ChannelDetailView = ({ store, nav }) => (
5962
<DetailField name="Balance">
6063
{store.selectedChannel.localBalanceLabel} {store.unitLabel}
6164
</DetailField>
62-
<Button style={styles.deleteBtn} onPress={() => nav.goChannelDelete()}>
63-
<ButtonText style={styles.deleteBtnText}>CLOSE CHANNEL</ButtonText>
64-
</Button>
65+
{!/close|closing/i.test(store.selectedChannel.status) ? (
66+
<Button
67+
style={styles.deleteBtn}
68+
onPress={() => nav.goChannelDelete()}
69+
>
70+
<ButtonText style={styles.deleteBtnText}>CLOSE CHANNEL</ButtonText>
71+
</Button>
72+
) : (
73+
<View style={styles.bottomPadding} />
74+
)}
6575
</Modal>
6676
</MainContent>
6777
</Background>

0 commit comments

Comments
 (0)