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

Commit 725a5de

Browse files
valentinewallacetanx
authored andcommitted
Hook up setMax payment action in pay bitcoin view.
1 parent ec6555e commit 725a5de

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/view/pay-bitcoin.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import Background from '../component/background';
66
import MainContent from '../component/main-content';
77
import { InputField, AmountInputField } from '../component/field';
88
import { Header, Title } from '../component/header';
9-
import { CancelButton, BackButton, PillButton } from '../component/button';
9+
import {
10+
Button,
11+
CancelButton,
12+
BackButton,
13+
PillButton,
14+
} from '../component/button';
1015
import Card from '../component/card';
1116
import BitcoinIcon from '../asset/icon/bitcoin';
1217
import { FormStretcher, FormText } from '../component/form';
@@ -18,12 +23,18 @@ const styles = StyleSheet.create({
1823
paddingLeft: 20,
1924
paddingRight: 20,
2025
},
21-
balance: {
22-
marginBottom: 10,
23-
},
2426
unit: {
2527
color: color.blackText,
2628
},
29+
maxBtn: {
30+
borderStyle: 'solid',
31+
borderWidth: 1,
32+
minHeight: 30,
33+
marginBottom: 10,
34+
},
35+
maxTxt: {
36+
paddingTop: 0,
37+
},
2738
nextBtn: {
2839
marginTop: 20,
2940
backgroundColor: color.orange,
@@ -57,6 +68,9 @@ const PayBitcoinView = ({ store, nav, payment }) => (
5768
{store.unitFiatLabel}
5869
</BalanceLabelUnit>
5970
</BalanceLabel>
71+
<Button style={styles.maxBtn} onPress={() => payment.setMax()}>
72+
<FormText style={styles.maxTxt}>MAX</FormText>
73+
</Button>
6074
<InputField
6175
placeholder="Bitcoin Address"
6276
value={store.payment.address}

stories/screen-story.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ sinon.stub(invoice, 'generateUri');
107107
const payment = new PaymentAction(store, grpc, nav, notify);
108108
sinon.stub(payment, 'checkType');
109109
sinon.stub(payment, 'payBitcoin');
110+
sinon.stub(payment, 'setMax');
110111
sinon.stub(payment, 'payLightning');
111112
sinon.stub(payment, 'initPayBitcoinConfirm');
112113
const channel = new ChannelAction(store, grpc, nav, notify);

0 commit comments

Comments
 (0)