Skip to content

Commit 414ef94

Browse files
authored
Payment Request: fix AMP switch (#825)
1 parent 8d98da5 commit 414ef94

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

views/PaymentRequest.tsx

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import * as React from 'react';
22
import { ScrollView, StyleSheet, Switch, Text, View } from 'react-native';
33
import { inject, observer } from 'mobx-react';
4-
import { Button, Header, Icon } from 'react-native-elements';
4+
import { Header, Icon } from 'react-native-elements';
55

66
import { Amount } from './../components/Amount';
7+
import Button from './../components/Button';
78
import HopPicker from './../components/HopPicker';
89
import KeyValue from './../components/KeyValue';
910
import LoadingIndicator from './../components/LoadingIndicator';
@@ -367,21 +368,40 @@ export default class PaymentRequest extends React.Component<
367368
'views.PaymentRequest.amp'
368369
)}
369370
</Text>
370-
<Switch
371-
value={enableAmp}
372-
onValueChange={() =>
373-
this.setState({
374-
enableAtomicMultiPathPayment:
375-
!enableAtomicMultiPathPayment
376-
})
377-
}
378-
trackColor={{
379-
false: '#767577',
380-
true: themeColor('highlight'),
381-
alignSelf: 'flex-end'
371+
<View
372+
style={{
373+
flex: 1,
374+
flexDirection: 'row',
375+
justifyContent: 'flex-end'
382376
}}
383-
disabled={lockAtomicMultiPathPayment}
384-
/>
377+
>
378+
<View
379+
style={{
380+
flex: 1,
381+
flexDirection: 'row',
382+
justifyContent: 'flex-end'
383+
}}
384+
>
385+
<Switch
386+
value={enableAmp}
387+
onValueChange={() =>
388+
this.setState({
389+
enableAtomicMultiPathPayment:
390+
!enableAtomicMultiPathPayment
391+
})
392+
}
393+
trackColor={{
394+
false: '#767577',
395+
true: themeColor(
396+
'highlight'
397+
)
398+
}}
399+
disabled={
400+
lockAtomicMultiPathPayment
401+
}
402+
/>
403+
</View>
404+
</View>
385405
</React.Fragment>
386406
)}
387407

@@ -516,10 +536,6 @@ export default class PaymentRequest extends React.Component<
516536
'SendingLightning'
517537
);
518538
}}
519-
buttonStyle={{
520-
backgroundColor: 'orange',
521-
borderRadius: 30
522-
}}
523539
/>
524540
</View>
525541
)}

0 commit comments

Comments
 (0)