Browse Source

Fix: Display share button correctly

zigzag
Pavel Ševčík 6 years ago
parent
commit
3861d04213
  1. 2
      screen/receive/details.js
  2. 48
      screen/receive/receiveAmount.js

2
screen/receive/details.js

@ -100,7 +100,7 @@ export default class ReceiveDetails extends Component {
</Animated.Text> </Animated.Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ marginBottom: 24 }}> <View style={{ marginBottom: 24, alignItems: 'center' }}>
<BlueButtonLink <BlueButtonLink
title={loc.receive.details.setAmount} title={loc.receive.details.setAmount}
onPress={() => { onPress={() => {

48
screen/receive/receiveAmount.js

@ -93,24 +93,13 @@ export default class ReceiveAmount extends Component {
logo={require('../../img/qr-code.png')} logo={require('../../img/qr-code.png')}
/> />
</View> </View>
<TouchableOpacity onPress={this.copyToClipboard}> <View style={{ marginBottom: 24, alignItems: 'center', justifyContent: 'space-between' }}>
<Animated.Text style={styles.address} numberOfLines={0}> <TouchableOpacity onPress={this.copyToClipboard}>
{this.state.addressText} <Animated.Text style={styles.address} numberOfLines={0}>
</Animated.Text> {this.state.addressText}
</TouchableOpacity> </Animated.Text>
<BlueButton </TouchableOpacity>
icon={{ </View>
name: 'share-alternative',
type: 'entypo',
color: BlueApp.settings.buttonTextColor,
}}
onPress={async () => {
Share.share({
message: bip21.encode(this.state.address, { amount: this.state.amount, label: this.state.label }),
});
}}
title={loc.receive.details.share}
/>
</View> </View>
); );
} }
@ -118,8 +107,7 @@ export default class ReceiveAmount extends Component {
render() { render() {
return ( return (
<SafeBlueArea style={{ flex: 1 }}> <SafeBlueArea style={{ flex: 1 }}>
<View style={{ flex: 1, justifyContent: 'space-between' }}> <View style={{ flex: 1, backgroundColor: '#FFFFFF', justifyContent: 'space-between' }}>
<View style={{ flex: 1, backgroundColor: '#FFFFFF' }}>
<KeyboardAvoidingView behavior="position"> <KeyboardAvoidingView behavior="position">
<BlueBitcoinAmount <BlueBitcoinAmount
amount={this.state.amount || ''} amount={this.state.amount || ''}
@ -128,8 +116,26 @@ export default class ReceiveAmount extends Component {
/> />
{this.state.amountSet ? this.renderWithSetAmount() : this.renderDefault()} {this.state.amountSet ? this.renderWithSetAmount() : this.renderDefault()}
</KeyboardAvoidingView> </KeyboardAvoidingView>
{this.state.amountSet && (
<BlueButton
buttonStyle={{
alignSelf: 'center',
marginBottom: 24,
}}
icon={{
name: 'share-alternative',
type: 'entypo',
color: BlueApp.settings.buttonTextColor,
}}
onPress={async () => {
Share.share({
message: bip21.encode(this.state.address, { amount: this.state.amount, label: this.state.label }),
});
}}
title={loc.receive.details.share}
/>
)}
</View> </View>
</View>
</SafeBlueArea> </SafeBlueArea>
); );
} }

Loading…
Cancel
Save