@@ -4,17 +4,13 @@ import { observer } from 'mobx-react';
4
4
import PropTypes from 'prop-types' ;
5
5
import Background from '../component/background' ;
6
6
import MainContent from '../component/main-content' ;
7
- import { NamedField } from '../component/field' ;
7
+ import { NamedField , AmountInputField } from '../component/field' ;
8
8
import { Header , Title } from '../component/header' ;
9
9
import { CancelButton , BackButton , SmallGlasButton } from '../component/button' ;
10
10
import Card from '../component/card' ;
11
11
import LightningBoltIcon from '../asset/icon/lightning-bolt' ;
12
12
import { FormStretcher } from '../component/form' ;
13
- import {
14
- BalanceLabel ,
15
- BalanceLabelNumeral ,
16
- BalanceLabelUnit ,
17
- } from '../component/label' ;
13
+ import { BalanceLabel , BalanceLabelUnit } from '../component/label' ;
18
14
import { color } from '../component/style' ;
19
15
20
16
const styles = StyleSheet . create ( {
@@ -52,19 +48,19 @@ const PayLightningSupplyAmountView = ({ store, nav, payment }) => (
52
48
< Card >
53
49
< FormStretcher >
54
50
< 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
+ />
58
60
< BalanceLabelUnit style = { styles . unit } >
59
- { store . unitLabel }
61
+ { store . unitFiatLabel }
60
62
</ BalanceLabelUnit >
61
63
</ 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 >
68
64
{ store . payment . note ? (
69
65
< NamedField name = "Note" style = { styles . note } >
70
66
{ store . payment . note }
@@ -73,7 +69,7 @@ const PayLightningSupplyAmountView = ({ store, nav, payment }) => (
73
69
</ FormStretcher >
74
70
</ Card >
75
71
</ MainContent >
76
- < SmallGlasButton onPress = { ( ) => payment . payLightning ( ) } >
72
+ < SmallGlasButton onPress = { ( ) => nav . goPayLightningConfirm ( ) } >
77
73
Confirm
78
74
</ SmallGlasButton >
79
75
</ Background >
0 commit comments