diff --git a/loc/en.js b/loc/en.js index efc0113b0..29cc7ee33 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 b3eebc8ee..b3612b981 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 7496e8ea0..fe0c85af7 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 c757ec7c8..8b672cdd8 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 6d79139ef..dfcbc01b5 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 1a4a234d1..ba42632be 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 b42caf256..a92ad2f0d 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} + + );