@@ -4,78 +4,82 @@ import { observer } from 'mobx-react';
44import PropTypes from 'prop-types' ;
55import Background from '../component/background' ;
66import MainContent from '../component/main-content' ;
7- import { NamedField } from '../component/field' ;
7+ import { NamedField , AmountInputField } from '../component/field' ;
88import { Header , Title } from '../component/header' ;
9- import { CancelButton , BackButton , PillButton } from '../component/button' ;
9+ import {
10+ MaxButton ,
11+ CancelButton ,
12+ BackButton ,
13+ PillButton ,
14+ } from '../component/button' ;
1015import Card from '../component/card' ;
1116import LightningBoltIcon from '../asset/icon/lightning-bolt' ;
12- import { FormStretcher } from '../component/form' ;
13- import {
14- BalanceLabel ,
15- BalanceLabelNumeral ,
16- BalanceLabelUnit ,
17- } from '../component/label' ;
17+ import { FormStretcher , FormText } from '../component/form' ;
18+ import { BalanceLabel , BalanceLabelUnit } from '../component/label' ;
1819import { color } from '../component/style' ;
1920
2021const styles = StyleSheet . create ( {
21- balance : {
22- marginBottom : 10 ,
23- } ,
24- numeral : {
25- color : color . blackText ,
22+ description : {
23+ paddingLeft : 20 ,
24+ paddingRight : 20 ,
2625 } ,
2726 unit : {
2827 color : color . blackText ,
2928 } ,
30- totalLbl : {
31- marginTop : 5 ,
32- } ,
33- note : {
34- marginTop : 5 ,
35- borderBottomWidth : 0 ,
29+ maxBtn : {
30+ marginTop : 10 ,
31+ marginBottom : 20 ,
3632 } ,
37- confirmBtn : {
33+ nextBtn : {
3834 marginTop : 20 ,
35+ backgroundColor : color . purple ,
3936 } ,
4037} ) ;
4138
4239const PayLightningSupplyAmountView = ( { store, nav, payment } ) => (
43- < Background image = " purple-gradient-bg" >
44- < Header shadow color = { color . purple } >
45- < BackButton onPress = { ( ) => nav . goPay ( ) } />
46- < Title title = "Supply Lightning Amount" >
40+ < Background color = { color . purple } >
41+ < Header color = { color . purple } >
42+ < BackButton onPress = { ( ) => nav . goHome ( ) } />
43+ < Title title = "Specify Amount to Send " >
4744 < LightningBoltIcon height = { 12 } width = { 6.1 } />
4845 </ Title >
4946 < CancelButton onPress = { ( ) => nav . goHome ( ) } />
5047 </ Header >
5148 < MainContent >
5249 < Card >
50+ < FormText style = { styles . description } >
51+ The invoice did not specify an amount.
52+ </ FormText >
5353 < FormStretcher >
5454 < BalanceLabel style = { styles . balance } >
55- < BalanceLabelNumeral style = { styles . numeral } >
56- { store . paymentAmountLabel }
57- </ BalanceLabelNumeral >
55+ < AmountInputField
56+ autoFocus = { true }
57+ value = { store . payment . amount }
58+ onChangeText = { amount => payment . setAmount ( { amount } ) }
59+ onSubmitEditing = { ( ) =>
60+ payment . estimateLightningFeeForAmount ( payment . amount )
61+ }
62+ />
5863 < BalanceLabelUnit style = { styles . unit } >
59- { store . unitLabel }
64+ { store . unitFiatLabel }
6065 </ BalanceLabelUnit >
6166 </ 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 >
67+ < MaxButton
68+ style = { styles . maxBtn }
69+ active = { store . payment . sendAll }
70+ onPress = { ( ) => payment . toggleMax ( ) }
71+ />
6872 { store . payment . note ? (
6973 < NamedField name = "Note" style = { styles . note } >
7074 { store . payment . note }
7175 </ NamedField >
7276 ) : null }
7377 </ FormStretcher >
7478 < PillButton
75- style = { styles . confirmBtn }
76- onPress = { ( ) => payment . payLightning ( ) }
79+ style = { styles . nextBtn }
80+ onPress = { ( ) => nav . goPayLightningConfirm ( ) }
7781 >
78- Confirm
82+ Pay
7983 </ PillButton >
8084 </ Card >
8185 </ MainContent >
0 commit comments