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

Commit cba1b1c

Browse files
committed
Unpolished zero value invoice support for mobile.
1 parent df0076d commit cba1b1c

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/view/pay-lightning-supply-amount-mobile.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ import { observer } from 'mobx-react';
44
import PropTypes from 'prop-types';
55
import Background from '../component/background';
66
import MainContent from '../component/main-content';
7-
import { NamedField } from '../component/field';
7+
import { NamedField, AmountInputField } from '../component/field';
88
import { Header, Title } from '../component/header';
99
import { CancelButton, BackButton, SmallGlasButton } from '../component/button';
1010
import Card from '../component/card';
1111
import LightningBoltIcon from '../asset/icon/lightning-bolt';
1212
import { FormStretcher } from '../component/form';
13-
import {
14-
BalanceLabel,
15-
BalanceLabelNumeral,
16-
BalanceLabelUnit,
17-
} from '../component/label';
13+
import { BalanceLabel, BalanceLabelUnit } from '../component/label';
1814
import { color } from '../component/style';
1915

2016
const styles = StyleSheet.create({
@@ -52,19 +48,19 @@ const PayLightningSupplyAmountView = ({ store, nav, payment }) => (
5248
<Card>
5349
<FormStretcher>
5450
<BalanceLabel style={styles.balance}>
55-
<BalanceLabelNumeral style={styles.numeral}>
56-
{store.paymentAmountLabel}
57-
</BalanceLabelNumeral>
51+
<AmountInputField
52+
style={styles.amountInput}
53+
autoFocus={true}
54+
value={store.payment.amount}
55+
onChangeText={amount => payment.setAmount({ amount })}
56+
onSubmitEditing={() =>
57+
payment.estimateLightningFeeForAmount(payment.amount)
58+
}
59+
/>
5860
<BalanceLabelUnit style={styles.unit}>
59-
{store.unitLabel}
61+
{store.unitFiatLabel}
6062
</BalanceLabelUnit>
6163
</BalanceLabel>
62-
<NamedField name="Fee">
63-
{store.paymentFeeLabel} {store.unitLabel}
64-
</NamedField>
65-
<NamedField name="Total" style={styles.totalLbl}>
66-
{store.paymentTotalLabel} {store.unitLabel}
67-
</NamedField>
6864
{store.payment.note ? (
6965
<NamedField name="Note" style={styles.note}>
7066
{store.payment.note}
@@ -73,7 +69,7 @@ const PayLightningSupplyAmountView = ({ store, nav, payment }) => (
7369
</FormStretcher>
7470
</Card>
7571
</MainContent>
76-
<SmallGlasButton onPress={() => payment.payLightning()}>
72+
<SmallGlasButton onPress={() => nav.goPayLightningConfirm()}>
7773
Confirm
7874
</SmallGlasButton>
7975
</Background>

0 commit comments

Comments
 (0)