From 81076a5e223d7e95a15419cca06038031e92877d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 18 Sep 2022 12:41:51 -0400 Subject: [PATCH] ADD: Export xPub as a file #4796 --- screen/receive/details.js | 1 - screen/wallets/xpub.js | 42 ++++++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/screen/receive/details.js b/screen/receive/details.js index 89cf5d49d..38063a4df 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -13,7 +13,6 @@ import { } from 'react-native'; import { useNavigation, useRoute, useTheme, useFocusEffect } from '@react-navigation/native'; import Share from 'react-native-share'; - import QRCodeComponent from '../../components/QRCodeComponent'; import { BlueLoading, diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js index 2d5826a6b..3831270c4 100644 --- a/screen/wallets/xpub.js +++ b/screen/wallets/xpub.js @@ -2,13 +2,14 @@ import React, { useCallback, useContext, useEffect, useState } from 'react'; import { InteractionManager, ActivityIndicator, View, StatusBar, StyleSheet } from 'react-native'; import { useFocusEffect, useRoute, useNavigation, useTheme } from '@react-navigation/native'; import navigationStyle from '../../components/navigationStyle'; -import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard } from '../../BlueComponents'; +import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard, BlueButton } from '../../BlueComponents'; import Privacy from '../../blue_modules/Privacy'; import Biometric from '../../class/biometrics'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; import QRCodeComponent from '../../components/QRCodeComponent'; import HandoffComponent from '../../components/handoff'; +import Share from 'react-native-share'; const styles = StyleSheet.create({ root: { @@ -20,6 +21,10 @@ const styles = StyleSheet.create({ flex: 1, justifyContent: 'center', }, + share: { + alignSelf: 'center', + width: '40%', + }, }); const WalletXpub = () => { @@ -68,6 +73,10 @@ const WalletXpub = () => { setQRCodeSize(height > width ? width - 40 : e.nativeEvent.layout.width / 1.8); }; + const handleShareButtonPressed = () => { + Share.open({ message: xpub }).catch(error => console.log(error)); + }; + return isLoading ? ( @@ -75,21 +84,26 @@ const WalletXpub = () => { ) : ( - - {wallet && ( - <> - - {wallet.typeReadable} - - - - )} - + <> + + {wallet && ( + <> + + {wallet.typeReadable} + + + + )} + - - + + + - + + + + ); };