From 6442042fa613edb02a249efa7f2b2add22723058 Mon Sep 17 00:00:00 2001 From: zeppi Date: Thu, 14 Jul 2022 17:20:22 -0400 Subject: [PATCH] add wallet sync export feature --- static/app-strings.json | 8 ++ ui/component/settingSystem/index.js | 2 + ui/component/settingSystem/view.jsx | 17 +++++ ui/component/walletExport/index.js | 9 +++ ui/component/walletExport/view.jsx | 112 ++++++++++++++++++++++++++++ ui/constants/modal_types.js | 1 + ui/modal/modalRouter/view.jsx | 3 + ui/modal/modalWalletExport/index.js | 9 +++ ui/modal/modalWalletExport/view.jsx | 18 +++++ 9 files changed, 179 insertions(+) create mode 100644 ui/component/walletExport/index.js create mode 100644 ui/component/walletExport/view.jsx create mode 100644 ui/modal/modalWalletExport/index.js create mode 100644 ui/modal/modalWalletExport/view.jsx diff --git a/static/app-strings.json b/static/app-strings.json index 01ecab3d9..b24d94504 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2316,5 +2316,13 @@ "Installing, please wait...": "Installing, please wait...", "There was an error during installation. Please, try again.": "There was an error during installation. Please, try again.", "Odysee Connect --[Section in Help Page]--": "Odysee Connect", + "Export Wallet": "Export Wallet", + "Export encrypted sync data for import in another app.": "Export encrypted sync data for import in another app.", + "Export wallet sync data. Choose a secure password you will need for import.": "Export wallet sync data. Choose a secure password you will need for import.", + "Choose Password": "Choose Password", + "Sync data copied.": "Sync data copied.", + "Your Sync Data is prepared. You can now copy or save it.": "Your Sync Data is prepared. You can now copy or save it.", + "Export wallet": "Export wallet", + "Sync data saved.": "Sync data saved.", "--end--": "--end--" } diff --git a/ui/component/settingSystem/index.js b/ui/component/settingSystem/index.js index 1c011735c..0bccedb25 100644 --- a/ui/component/settingSystem/index.js +++ b/ui/component/settingSystem/index.js @@ -6,6 +6,7 @@ import { doNotifyDecryptWallet, doNotifyEncryptWallet, doNotifyForgetPassword, + doOpenModal, doToggle3PAnalytics, } from 'redux/actions/app'; import { doSetDaemonSetting, doClearDaemonSetting, doFindFFmpeg } from 'redux/actions/settings'; @@ -25,6 +26,7 @@ const select = (state) => ({ }); const perform = (dispatch) => ({ + openModal: (modal, props) => dispatch(doOpenModal(modal, props)), setDaemonSetting: (key, value) => dispatch(doSetDaemonSetting(key, value)), clearDaemonSetting: (key) => dispatch(doClearDaemonSetting(key)), clearCache: () => dispatch(doClearCache()), diff --git a/ui/component/settingSystem/view.jsx b/ui/component/settingSystem/view.jsx index af40546f8..962c55745 100644 --- a/ui/component/settingSystem/view.jsx +++ b/ui/component/settingSystem/view.jsx @@ -18,6 +18,7 @@ import { getPasswordFromCookie } from 'util/saved-passwords'; import * as DAEMON_SETTINGS from 'constants/daemon_settings'; import SettingEnablePrereleases from 'component/settingEnablePrereleases'; import SettingDisableAutoUpdates from 'component/settingDisableAutoUpdates'; +import * as MODALS from 'constants/modal_types'; const IS_MAC = process.platform === 'darwin'; @@ -56,6 +57,7 @@ type Props = { updateWalletStatus: () => void, confirmForgetPassword: ({}) => void, toggle3PAnalytics: (boolean) => void, + openModal: (string, any) => void, }; export default function SettingSystem(props: Props) { @@ -75,6 +77,7 @@ export default function SettingSystem(props: Props) { updateWalletStatus, confirmForgetPassword, toggle3PAnalytics, + openModal, } = props; const [clearingCache, setClearingCache] = React.useState(false); @@ -391,6 +394,20 @@ export default function SettingSystem(props: Props) { disabled={clearingCache} /> + +