From 814f5b635e38d42be0bcf26c30739dd7b927bbbd Mon Sep 17 00:00:00 2001
From: Joshua Campbell
Date: Mon, 1 Jul 2019 14:00:20 -0700
Subject: [PATCH] Replace copy button by using CopyableText for the lbryum
path.
---
src/ui/component/walletBackup/view.jsx | 27 +++-----------------------
1 file changed, 3 insertions(+), 24 deletions(-)
diff --git a/src/ui/component/walletBackup/view.jsx b/src/ui/component/walletBackup/view.jsx
index 73d2d0812..c37a3160f 100644
--- a/src/ui/component/walletBackup/view.jsx
+++ b/src/ui/component/walletBackup/view.jsx
@@ -1,7 +1,8 @@
// @flow
import * as React from 'react';
-import { shell, clipboard, remote } from 'electron';
+import { shell, remote } from 'electron';
import Button from 'component/button';
+import CopyableText from 'component/copyableText';
import AdmZip from 'adm-zip';
import path from 'path';
@@ -34,12 +35,6 @@ class WalletBackup extends React.PureComponent {
this.setState({ successMessage: message });
}
- flashSuccessMessage(message: string, delay: ?number) {
- delay = delay || 2000;
- this.showSuccessMessage(message);
- setTimeout(() => this.setState({ successMessage: null }), delay, { once: true });
- }
-
clearMessages() {
this.setState({ errorMessage: null, successMessage: null });
}
@@ -89,17 +84,6 @@ class WalletBackup extends React.PureComponent {
shell.showItemInFolder(outputPath);
}
- copyWalletDirToClipboard(lbryumWalletDir: ?string) {
- this.clearMessages();
-
- if (lbryumWalletDir) {
- clipboard.writeText(lbryumWalletDir);
- this.flashSuccessMessage(__('Copied path to clipboard.'));
- } else {
- this.showErrorMessage(__('No wallet folder was found.'));
- }
- }
-
render() {
const { daemonSettings } = this.props;
const { wallet_dir: lbryumWalletDir } = daemonSettings;
@@ -135,7 +119,7 @@ class WalletBackup extends React.PureComponent {
'However, it is fairly easy to back up manually. To backup your wallet, make a copy of the folder listed below:'
)}
-
{lbryumWalletDir}
+
{__(
'Access to these files are equivalent to having access to your credits. Keep any copies you make of your wallet in a secure place.'
@@ -153,11 +137,6 @@ class WalletBackup extends React.PureComponent {
{this.state.successMessage}