From c7c17843b041b4ce45f3262be293ecbfa7378dd2 Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Mon, 16 Apr 2018 11:36:14 -0400 Subject: [PATCH] Deprecation Warning for Insecure Unlocks (#1526) --- .../WalletDecrypt/components/DeprecationWarning.tsx | 12 ++++++++++++ .../components/WalletDecrypt/components/Keystore.tsx | 2 ++ .../components/WalletDecrypt/components/Mnemonic.tsx | 6 ++++-- .../WalletDecrypt/components/PrivateKey.tsx | 2 ++ common/sass/styles/scaffolding.scss | 4 ++++ common/translations/lang/en.json | 1 + 6 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 common/components/WalletDecrypt/components/DeprecationWarning.tsx diff --git a/common/components/WalletDecrypt/components/DeprecationWarning.tsx b/common/components/WalletDecrypt/components/DeprecationWarning.tsx new file mode 100644 index 00000000..82eab917 --- /dev/null +++ b/common/components/WalletDecrypt/components/DeprecationWarning.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import translate from 'translations'; + +const DeprecationWarning: React.SFC<{}> = () => { + if (process.env.BUILD_DOWNLOADABLE) { + return null; + } + + return
{translate('INSECURE_WALLET_DEPRECATION')}
; +}; + +export default DeprecationWarning; diff --git a/common/components/WalletDecrypt/components/Keystore.tsx b/common/components/WalletDecrypt/components/Keystore.tsx index 952eb0ab..7fb12414 100644 --- a/common/components/WalletDecrypt/components/Keystore.tsx +++ b/common/components/WalletDecrypt/components/Keystore.tsx @@ -4,6 +4,7 @@ import translate, { translateRaw } from 'translations'; import Spinner from 'components/ui/Spinner'; import { TShowNotification } from 'actions/notifications'; import { Input } from 'components/ui'; +import DeprecationWarning from './DeprecationWarning'; export interface KeystoreValue { file: string; @@ -44,6 +45,7 @@ export class KeystoreDecrypt extends PureComponent { return (
+
{ const isValidMnemonic = validateMnemonic(formattedPhrase); return ( -
+ +
{ onConfirmAddress={this.handleUnlock} onPathChange={this.handlePathChange} /> -
+ ); } diff --git a/common/components/WalletDecrypt/components/PrivateKey.tsx b/common/components/WalletDecrypt/components/PrivateKey.tsx index 425edb3c..3bef3636 100644 --- a/common/components/WalletDecrypt/components/PrivateKey.tsx +++ b/common/components/WalletDecrypt/components/PrivateKey.tsx @@ -4,6 +4,7 @@ import React, { PureComponent } from 'react'; import translate, { translateRaw } from 'translations'; import { TogglablePassword } from 'components'; import { Input } from 'components/ui'; +import DeprecationWarning from './DeprecationWarning'; export interface PrivateKeyValue { key: string; @@ -54,6 +55,7 @@ export class PrivateKeyDecrypt extends PureComponent { return ( +