diff --git a/src/ui/component/router/view.jsx b/src/ui/component/router/view.jsx index 47e2fbf86..e60197c1c 100644 --- a/src/ui/component/router/view.jsx +++ b/src/ui/component/router/view.jsx @@ -14,7 +14,6 @@ import FileListPublished from 'page/fileListPublished'; import TransactionHistoryPage from 'page/transactionHistory'; import AuthPage from 'page/auth'; import InvitePage from 'page/invite'; -import BackupPage from 'page/backup'; import SubscriptionsPage from 'page/subscriptions'; import SearchPage from 'page/search'; import UserHistoryPage from 'page/userHistory'; @@ -39,7 +38,6 @@ export default function AppRouter() { - diff --git a/src/ui/component/sideBar/view.jsx b/src/ui/component/sideBar/view.jsx index c055af4b6..01740b4aa 100644 --- a/src/ui/component/sideBar/view.jsx +++ b/src/ui/component/sideBar/view.jsx @@ -91,11 +91,6 @@ class SideBar extends React.PureComponent { { ...buildLink(PAGES.SETTINGS, __('Settings'), ICONS.SETTINGS), }, - // @if TARGET='app' - { - ...buildLink(PAGES.BACKUP, __('Backup'), ICONS.BACKUP), - }, - // @endif ].map(renderLink)} diff --git a/src/ui/page/backup/index.js b/src/ui/component/walletBackup/index.js similarity index 69% rename from src/ui/page/backup/index.js rename to src/ui/component/walletBackup/index.js index df4f971d8..5d0057d8b 100644 --- a/src/ui/page/backup/index.js +++ b/src/ui/component/walletBackup/index.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux'; import { selectDaemonSettings } from 'redux/selectors/settings'; -import BackupPage from './view'; +import WalletBackup from './view'; const select = state => ({ daemonSettings: selectDaemonSettings(state), }); -export default connect(select)(BackupPage); +export default connect(select)(WalletBackup); diff --git a/src/ui/component/walletBackup/view.jsx b/src/ui/component/walletBackup/view.jsx new file mode 100644 index 000000000..322cf0dec --- /dev/null +++ b/src/ui/component/walletBackup/view.jsx @@ -0,0 +1,66 @@ +// @flow +import * as React from 'react'; +import Button from 'component/button'; + +type Props = { + daemonSettings: { + wallet_dir: ?string, + }, +}; + +class WalletBackup extends React.PureComponent { + render() { + const { daemonSettings } = this.props; + const { wallet_dir: lbryumWalletDir } = daemonSettings; + + const noDaemonSettings = Object.keys(daemonSettings).length === 0; + + return ( +
+ {noDaemonSettings ? ( +
+

{__('Failed to load settings.')}

+
+ ) : ( + +
+

{__('Backup Your LBRY Credits')}

+ +

+ {__( + 'Your LBRY credits are controllable by you and only you, via wallet file(s) stored locally on your computer.' + )} +

+
+ +
+

+ {__( + 'Currently, there is no automatic wallet backup. If you lose access to these files, you will lose your credits permanently.' + )} +

+

+ {__( + '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.' + )} +

+

+ For more details on backing up and best practices,{' '} +

+
+ )} +
+ ); + } +} + +export default WalletBackup; diff --git a/src/ui/page/help/view.jsx b/src/ui/page/help/view.jsx index b7fdde058..e71079928 100644 --- a/src/ui/page/help/view.jsx +++ b/src/ui/page/help/view.jsx @@ -2,7 +2,6 @@ // @flow import * as icons from 'constants/icons'; import * as React from 'react'; -import classnames from 'classnames'; // @if TARGET='app' import { shell } from 'electron'; // @endif @@ -10,6 +9,7 @@ import { Lbry } from 'lbry-redux'; import Native from 'native'; import Button from 'component/button'; import Page from 'component/page'; +import BackupSection from 'component/walletBackup'; type DeamonSettings = { data_dir: string | any, @@ -194,6 +194,10 @@ class HelpPage extends React.PureComponent { + {/* @if TARGET='app' */} + + {/* @endif */} +

{__('About')}