diff --git a/loc/en.js b/loc/en.js index efc0113b..29cc7ee3 100644 --- a/loc/en.js +++ b/loc/en.js @@ -67,6 +67,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'Copied to clipboard.', }, import: { title: 'import', diff --git a/loc/es.js b/loc/es.js index b3eebc8e..b3612b98 100644 --- a/loc/es.js +++ b/loc/es.js @@ -67,6 +67,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'Copiado a portapapeles.', }, import: { title: 'importar', diff --git a/loc/pt_BR.js b/loc/pt_BR.js index 7496e8ea..fe0c85af 100644 --- a/loc/pt_BR.js +++ b/loc/pt_BR.js @@ -68,6 +68,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'copiado para clip board', }, import: { title: 'importar', diff --git a/loc/pt_PT.js b/loc/pt_PT.js index c757ec7c..8b672cdd 100644 --- a/loc/pt_PT.js +++ b/loc/pt_PT.js @@ -67,6 +67,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'copiado para clip board', }, import: { title: 'importar', diff --git a/loc/ru.js b/loc/ru.js index 6d79139e..dfcbc01b 100644 --- a/loc/ru.js +++ b/loc/ru.js @@ -67,6 +67,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'скопировано', }, import: { title: 'import', diff --git a/loc/ua.js b/loc/ua.js index 1a4a234d..ba42632b 100644 --- a/loc/ua.js +++ b/loc/ua.js @@ -67,6 +67,7 @@ module.exports = { }, xpub: { title: 'wallet XPUB', + copiedToClipboard: 'Зкопіювано', }, import: { title: 'імпорт', diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js index b42caf25..a92ad2f0 100644 --- a/screen/wallets/xpub.js +++ b/screen/wallets/xpub.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Dimensions, Platform, ActivityIndicator, View } from 'react-native'; +import { Dimensions, Platform, ActivityIndicator, View, Clipboard, Animated, TouchableOpacity } from 'react-native'; import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; import { BlueSpacing40, SafeBlueArea, BlueCard, BlueText, BlueHeaderDefaultSub } from '../../BlueComponents'; import PropTypes from 'prop-types'; @@ -40,6 +40,7 @@ export default class WalletXpub extends Component { isLoading: true, wallet, xpub: wallet.getXpub(), + xpubText: wallet.getXpub(), }; } @@ -61,6 +62,13 @@ export default class WalletXpub extends Component { return 312; }; + copyToClipboard = () => { + this.setState({ xpubText: loc.wallets.xpub.copiedToClipboard }, () => { + Clipboard.setString(this.state.xpub); + setTimeout(() => this.setState({ xpubText: this.state.xpub }), 1000); + }); + }; + render() { if (this.state.isLoading) { return ( @@ -124,7 +132,11 @@ export default class WalletXpub extends Component { } })()} - {this.state.xpub} + + + {this.state.xpubText} + + );