-
+
+
-
Always look for this icon when sending to this wallet
+
+ Always look for this icon when sending to this wallet
+
);
}
+
+ public toPNG = async () => {
+ if (!this.container) {
+ return '';
+ }
+ const canvas = await html2canvas(this.container);
+ return canvas.toDataURL('image/png');
+ };
}
diff --git a/common/components/ParityQrSigner.tsx b/common/components/ParityQrSigner.tsx
index aca8bf94..5d508a43 100644
--- a/common/components/ParityQrSigner.tsx
+++ b/common/components/ParityQrSigner.tsx
@@ -1,8 +1,9 @@
import React from 'react';
import classnames from 'classnames';
+import QrSigner from '@parity/qr-signer';
+
import translate from 'translations';
import { Spinner } from 'components/ui';
-import QrSigner from '@parity/qr-signer';
import './ParityQrSigner.scss';
interface State {
diff --git a/common/components/PrintableWallet/index.tsx b/common/components/PrintableWallet/index.tsx
index 3800b5b3..e55dcde0 100644
--- a/common/components/PrintableWallet/index.tsx
+++ b/common/components/PrintableWallet/index.tsx
@@ -1,53 +1,54 @@
-import { PaperWallet } from 'components';
import React from 'react';
-import printElement from 'utils/printElement';
-import { stripHexPrefix } from 'libs/values';
-import translate, { translateRaw } from 'translations';
-export const print = (address: string, privateKey: string) => () =>
- address &&
- privateKey &&
- printElement(
, {
- popupFeatures: {
- scrollbars: 'no'
- },
- styles: `
- * {
- box-sizing: border-box;
- }
-
- body {
- font-family: Lato, sans-serif;
- font-size: 1rem;
- line-height: 1.4;
- margin: 0;
- }
- `
- });
+import translate from 'translations';
+import { stripHexPrefix } from 'libs/formatters';
+import { PaperWallet } from 'components';
interface Props {
address: string;
privateKey: string;
}
-const PrintableWallet: React.SFC
= ({ address, privateKey }) => {
- const pkey = stripHexPrefix(privateKey);
+interface State {
+ paperWalletImage: string;
+}
- return (
-
- );
-};
+export default class PrintableWallet extends React.Component {
+ public state: State = {
+ paperWalletImage: ''
+ };
-export default PrintableWallet;
+ private paperWallet: PaperWallet | null;
+
+ public componentDidMount() {
+ setTimeout(() => {
+ if (!this.paperWallet) {
+ return this.componentDidMount();
+ }
+
+ this.paperWallet.toPNG().then(png => this.setState({ paperWalletImage: png }));
+ }, 500);
+ }
+
+ public render() {
+ const { address, privateKey } = this.props;
+ const { paperWalletImage } = this.state;
+ const pkey = stripHexPrefix(privateKey);
+ const disabled = paperWalletImage ? '' : 'disabled';
+
+ return (
+
+ );
+ }
+}
diff --git a/common/components/SendButton.tsx b/common/components/SendButton.tsx
index 4664480e..d17c5e94 100644
--- a/common/components/SendButton.tsx
+++ b/common/components/SendButton.tsx
@@ -1,8 +1,9 @@
import React from 'react';
-import { SendButtonFactory } from './SendButtonFactory';
+
import translate from 'translations';
-import { ConfirmationModal } from 'components/ConfirmationModal';
import { SigningStatus } from 'components';
+import { ConfirmationModal } from 'components/ConfirmationModal';
+import { SendButtonFactory } from './SendButtonFactory';
import './SendButton.scss';
export const SendButton: React.SFC<{
diff --git a/common/components/SendButtonFactory/OfflineBroadcast.tsx b/common/components/SendButtonFactory/OfflineBroadcast.tsx
index 1caf46a5..dde98c5b 100644
--- a/common/components/SendButtonFactory/OfflineBroadcast.tsx
+++ b/common/components/SendButtonFactory/OfflineBroadcast.tsx
@@ -1,8 +1,9 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
-import { AppState } from 'reducers';
-import { getOffline } from 'selectors/config';
+
+import { AppState } from 'features/reducers';
+import { getOffline } from 'features/config';
import { NewTabLink } from 'components/ui';
interface StateProps {
diff --git a/common/components/SendButtonFactory/OnlineSend.tsx b/common/components/SendButtonFactory/OnlineSend.tsx
index 124ad123..a9a9d482 100644
--- a/common/components/SendButtonFactory/OnlineSend.tsx
+++ b/common/components/SendButtonFactory/OnlineSend.tsx
@@ -1,22 +1,21 @@
import React, { Component } from 'react';
-import { getOffline } from 'selectors/config';
-import { AppState } from 'reducers';
import { connect } from 'react-redux';
+
+import { AppState } from 'features/reducers';
+import * as derivedSelectors from 'features/selectors';
+import { getOffline } from 'features/config';
import {
- getCurrentTransactionStatus,
- currentTransactionBroadcasted,
- signaturePending,
- getSignedTx,
- getWeb3Tx
-} from 'selectors/transaction';
-import { showNotification, TShowNotification } from 'actions/notifications';
-import { ITransactionStatus } from 'reducers/transaction/broadcast';
-import { TSignTransactionRequested, signTransactionRequested } from 'actions/transaction';
+ transactionBroadcastTypes,
+ transactionSignActions,
+ transactionSignSelectors,
+ transactionSelectors
+} from 'features/transaction';
+import { notificationsActions } from 'features/notifications';
import { ConfirmationModal } from 'components/ConfirmationModal';
interface StateProps {
offline: boolean;
- currentTransaction: false | ITransactionStatus | null;
+ currentTransaction: false | transactionBroadcastTypes.ITransactionStatus | null;
transactionBroadcasted: boolean;
signaturePending: boolean;
signedTx: boolean;
@@ -27,9 +26,8 @@ interface State {
}
interface DispatchProps {
- showNotification: TShowNotification;
-
- signTransactionRequested: TSignTransactionRequested;
+ showNotification: notificationsActions.TShowNotification;
+ signTransactionRequested: transactionSignActions.TSignTransactionRequested;
}
interface OwnProps {
@@ -90,10 +88,14 @@ class OnlineSendClass extends Component {
export const OnlineSend = connect(
(state: AppState) => ({
offline: getOffline(state),
- currentTransaction: getCurrentTransactionStatus(state),
- transactionBroadcasted: currentTransactionBroadcasted(state),
- signaturePending: signaturePending(state).isSignaturePending,
- signedTx: !!getSignedTx(state) || !!getWeb3Tx(state)
+ currentTransaction: transactionSelectors.getCurrentTransactionStatus(state),
+ transactionBroadcasted: transactionSelectors.currentTransactionBroadcasted(state),
+ signaturePending: derivedSelectors.signaturePending(state).isSignaturePending,
+ signedTx:
+ !!transactionSignSelectors.getSignedTx(state) || !!transactionSignSelectors.getWeb3Tx(state)
}),
- { showNotification, signTransactionRequested }
+ {
+ showNotification: notificationsActions.showNotification,
+ signTransactionRequested: transactionSignActions.signTransactionRequested
+ }
)(OnlineSendClass);
diff --git a/common/components/SendButtonFactory/SendButtonFactory.tsx b/common/components/SendButtonFactory/SendButtonFactory.tsx
index 5bed56d6..0f00ad96 100644
--- a/common/components/SendButtonFactory/SendButtonFactory.tsx
+++ b/common/components/SendButtonFactory/SendButtonFactory.tsx
@@ -1,19 +1,17 @@
-import EthTx from 'ethereumjs-tx';
-import { OnlineSend } from './OnlineSend';
-import { getWalletType, IWalletType } from 'selectors/wallet';
import React, { Component } from 'react';
import { connect } from 'react-redux';
-import { AppState } from 'reducers';
-import { ConfirmationModal } from 'components/ConfirmationModal';
+import EthTx from 'ethereumjs-tx';
+
+import { AppState } from 'features/reducers';
+import * as derivedSelectors from 'features/selectors';
+import { walletSelectors } from 'features/wallet';
import {
- getSerializedTransaction,
- getTransaction,
- isNetworkRequestPending,
- isValidGasPrice,
- isValidGasLimit,
- getSignedTx,
- getWeb3Tx
-} from 'selectors/transaction';
+ transactionNetworkSelectors,
+ transactionSignSelectors,
+ transactionSelectors
+} from 'features/transaction';
+import { ConfirmationModal } from 'components/ConfirmationModal';
+import { OnlineSend } from './OnlineSend';
export interface CallbackProps {
disabled: boolean;
@@ -22,7 +20,7 @@ export interface CallbackProps {
}
interface StateProps {
- walletType: IWalletType;
+ walletType: walletSelectors.IWalletType;
serializedTransaction: AppState['transaction']['sign']['local']['signedTransaction'];
transaction: EthTx;
isFullTransaction: boolean;
@@ -76,13 +74,14 @@ export class SendButtonFactoryClass extends Component {
const mapStateToProps = (state: AppState) => {
return {
- walletType: getWalletType(state),
- serializedTransaction: getSerializedTransaction(state),
- ...getTransaction(state),
- networkRequestPending: isNetworkRequestPending(state),
- validGasPrice: isValidGasPrice(state),
- validGasLimit: isValidGasLimit(state),
- signedTx: !!getSignedTx(state) || !!getWeb3Tx(state)
+ walletType: walletSelectors.getWalletType(state),
+ serializedTransaction: derivedSelectors.getSerializedTransaction(state),
+ ...derivedSelectors.getTransaction(state),
+ networkRequestPending: transactionNetworkSelectors.isNetworkRequestPending(state),
+ validGasPrice: transactionSelectors.isValidGasPrice(state),
+ validGasLimit: transactionSelectors.isValidGasLimit(state),
+ signedTx:
+ !!transactionSignSelectors.getSignedTx(state) || !!transactionSignSelectors.getWeb3Tx(state)
};
};
diff --git a/common/components/SendEverything/SendEverything.tsx b/common/components/SendEverything/SendEverything.tsx
index e9307556..c3a7dd09 100644
--- a/common/components/SendEverything/SendEverything.tsx
+++ b/common/components/SendEverything/SendEverything.tsx
@@ -1,12 +1,13 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
+
+import translate, { translateRaw } from 'translations';
+import { TokenValue, Wei } from 'libs/units';
+import { AppState } from 'features/reducers';
+import { sendEverythingRequested, TSendEverythingRequested } from 'features/transaction/actions';
+import * as selectors from 'features/selectors';
import { Query } from 'components/renderCbs';
import { Tooltip } from 'components/ui';
-import { TokenValue, Wei } from 'libs/units';
-import translate, { translateRaw } from 'translations';
-import { sendEverythingRequested, TSendEverythingRequested } from 'actions/transaction';
-import { getCurrentBalance } from 'selectors/wallet';
-import { AppState } from 'reducers';
import './SendEverything.scss';
interface DispatchProps {
@@ -43,6 +44,6 @@ class SendEverythingClass extends Component {
};
}
export const SendEverything = connect(
- (state: AppState) => ({ currentBalance: getCurrentBalance(state) }),
+ (state: AppState) => ({ currentBalance: selectors.getCurrentBalance(state) }),
{ sendEverythingRequested }
)(SendEverythingClass);
diff --git a/common/components/SigningStatus.tsx b/common/components/SigningStatus.tsx
index ff65d57c..a2200124 100644
--- a/common/components/SigningStatus.tsx
+++ b/common/components/SigningStatus.tsx
@@ -1,10 +1,12 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
-import { AppState } from 'reducers';
-import { signaturePending } from 'selectors/transaction';
+
+import { translate } from 'translations';
+import { AppState } from 'features/reducers';
+import * as selectors from 'features/selectors';
import { Spinner } from 'components/ui';
import './SigningStatus.scss';
-import { translate } from 'translations';
+
interface StateProps {
isSignaturePending: boolean;
isHardwareWallet: boolean;
@@ -30,6 +32,6 @@ class SigningStatusClass extends Component {
}
}
-export const SigningStatus = connect((state: AppState) => signaturePending(state))(
+export const SigningStatus = connect((state: AppState) => selectors.signaturePending(state))(
SigningStatusClass
);
diff --git a/common/components/SubTabs/index.tsx b/common/components/SubTabs/index.tsx
index c9819a0a..7f18d33a 100644
--- a/common/components/SubTabs/index.tsx
+++ b/common/components/SubTabs/index.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import Select, { Option } from 'react-select';
import { NavLink, RouteComponentProps } from 'react-router-dom';
+import Select, { Option } from 'react-select';
+
import './SubTabs.scss';
export interface Tab {
diff --git a/common/components/TXMetaDataPanel/TXMetaDataPanel.tsx b/common/components/TXMetaDataPanel/TXMetaDataPanel.tsx
index da1bfff3..f21240ae 100644
--- a/common/components/TXMetaDataPanel/TXMetaDataPanel.tsx
+++ b/common/components/TXMetaDataPanel/TXMetaDataPanel.tsx
@@ -1,26 +1,21 @@
import React from 'react';
-import BN from 'bn.js';
import { connect } from 'react-redux';
-import {
- inputGasPrice,
- TInputGasPrice,
- inputGasPriceIntent,
- TInputGasPriceIntent,
- getNonceRequested,
- TGetNonceRequested,
- resetTransactionRequested,
- TResetTransactionRequested
-} from 'actions/transaction';
-import { fetchCCRatesRequested, TFetchCCRatesRequested } from 'actions/rates';
-import { getNetworkConfig, getOffline } from 'selectors/config';
-import { AppState } from 'reducers';
-import { Units } from 'libs/units';
-import SimpleGas from './components/SimpleGas';
-import AdvancedGas, { AdvancedOptions } from './components/AdvancedGas';
-import './TXMetaDataPanel.scss';
-import { getGasPrice } from 'selectors/transaction';
-import { NetworkConfig } from 'types/network';
+import BN from 'bn.js';
+
import { translateRaw } from 'translations';
+import { NetworkConfig } from 'types/network';
+import { Units } from 'libs/units';
+import { AppState } from 'features/reducers';
+import { getOffline, getNetworkConfig } from 'features/config';
+import {
+ transactionFieldsActions,
+ transactionFieldsSelectors,
+ transactionNetworkActions
+} from 'features/transaction';
+import { ratesActions } from 'features/rates';
+import AdvancedGas, { AdvancedOptions } from './components/AdvancedGas';
+import SimpleGas from './components/SimpleGas';
+import './TXMetaDataPanel.scss';
type SliderStates = 'simple' | 'advanced';
@@ -31,11 +26,11 @@ interface StateProps {
}
interface DispatchProps {
- inputGasPrice: TInputGasPrice;
- inputGasPriceIntent: TInputGasPriceIntent;
- fetchCCRates: TFetchCCRatesRequested;
- getNonceRequested: TGetNonceRequested;
- resetTransactionRequested: TResetTransactionRequested;
+ inputGasPrice: transactionFieldsActions.TInputGasPrice;
+ inputGasPriceIntent: transactionFieldsActions.TInputGasPriceIntent;
+ fetchCCRates: ratesActions.TFetchCCRatesRequested;
+ getNonceRequested: transactionNetworkActions.TGetNonceRequested;
+ resetTransactionRequested: transactionFieldsActions.TResetTransactionRequested;
}
// Set default props for props that can't be truthy or falsy
@@ -68,9 +63,14 @@ class TXMetaDataPanel extends React.Component {
sliderState: (this.props as DefaultProps).initialState
};
- public componentDidMount() {
+ public componentWillMount() {
if (!this.props.offline) {
this.props.resetTransactionRequested();
+ }
+ }
+
+ public componentDidMount() {
+ if (!this.props.offline) {
this.props.fetchCCRates([this.props.network.unit]);
this.props.getNonceRequested();
}
@@ -143,16 +143,16 @@ class TXMetaDataPanel extends React.Component {
function mapStateToProps(state: AppState): StateProps {
return {
- gasPrice: getGasPrice(state),
+ gasPrice: transactionFieldsSelectors.getGasPrice(state),
offline: getOffline(state),
network: getNetworkConfig(state)
};
}
export default connect(mapStateToProps, {
- inputGasPrice,
- inputGasPriceIntent,
- fetchCCRates: fetchCCRatesRequested,
- getNonceRequested,
- resetTransactionRequested
+ inputGasPrice: transactionFieldsActions.inputGasPrice,
+ inputGasPriceIntent: transactionFieldsActions.inputGasPriceIntent,
+ fetchCCRates: ratesActions.fetchCCRatesRequested,
+ getNonceRequested: transactionNetworkActions.getNonceRequested,
+ resetTransactionRequested: transactionFieldsActions.resetTransactionRequested
})(TXMetaDataPanel);
diff --git a/common/components/TXMetaDataPanel/components/AdvancedGas.tsx b/common/components/TXMetaDataPanel/components/AdvancedGas.tsx
index 7ca48c60..366905b2 100644
--- a/common/components/TXMetaDataPanel/components/AdvancedGas.tsx
+++ b/common/components/TXMetaDataPanel/components/AdvancedGas.tsx
@@ -1,17 +1,16 @@
import React from 'react';
+import { connect } from 'react-redux';
+
+import { EAC_SCHEDULING_CONFIG } from 'libs/scheduling';
import { translateRaw } from 'translations';
+import { AppState } from 'features/reducers';
+import { TToggleAutoGasLimit, toggleAutoGasLimit, getAutoGasLimitEnabled } from 'features/config';
+import { scheduleSelectors } from 'features/schedule';
+import { transactionFieldsActions, transactionSelectors } from 'features/transaction';
+import { NonceField, GasLimitField, DataField } from 'components';
+import { Input } from 'components/ui';
import FeeSummary, { RenderData } from './FeeSummary';
import './AdvancedGas.scss';
-import { TToggleAutoGasLimit, toggleAutoGasLimit } from 'actions/config';
-import { AppState } from 'reducers';
-import { TInputGasPrice } from 'actions/transaction';
-import { NonceField, GasLimitField, DataField } from 'components';
-import { connect } from 'react-redux';
-import { getAutoGasLimitEnabled } from 'selectors/config';
-import { isValidGasPrice } from 'selectors/transaction';
-import { Input } from 'components/ui';
-import { EAC_SCHEDULING_CONFIG } from 'libs/scheduling';
-import { getScheduleGasPrice, getTimeBounty } from 'selectors/schedule';
export interface AdvancedOptions {
gasPriceField?: boolean;
@@ -22,7 +21,7 @@ export interface AdvancedOptions {
}
interface OwnProps {
- inputGasPrice: TInputGasPrice;
+ inputGasPrice: transactionFieldsActions.TInputGasPrice;
gasPrice: AppState['transaction']['fields']['gasPrice'];
options?: AdvancedOptions;
scheduling?: boolean;
@@ -185,9 +184,9 @@ class AdvancedGas extends React.Component {
export default connect(
(state: AppState) => ({
autoGasLimitEnabled: getAutoGasLimitEnabled(state),
- scheduleGasPrice: getScheduleGasPrice(state),
- timeBounty: getTimeBounty(state),
- validGasPrice: isValidGasPrice(state)
+ scheduleGasPrice: scheduleSelectors.getScheduleGasPrice(state),
+ timeBounty: scheduleSelectors.getTimeBounty(state),
+ validGasPrice: transactionSelectors.isValidGasPrice(state)
}),
{ toggleAutoGasLimit }
)(AdvancedGas);
diff --git a/common/components/TXMetaDataPanel/components/FeeSummary.tsx b/common/components/TXMetaDataPanel/components/FeeSummary.tsx
index 5165af52..5005ce34 100644
--- a/common/components/TXMetaDataPanel/components/FeeSummary.tsx
+++ b/common/components/TXMetaDataPanel/components/FeeSummary.tsx
@@ -1,16 +1,17 @@
import React from 'react';
-import BN from 'bn.js';
import { connect } from 'react-redux';
-import { AppState } from 'reducers';
+import BN from 'bn.js';
import classNames from 'classnames';
-import { getNetworkConfig, getOffline } from 'selectors/config';
-import { getIsEstimating } from 'selectors/gas';
-import { getGasLimit } from 'selectors/transaction';
-import { UnitDisplay, Spinner } from 'components/ui';
+
import { NetworkConfig } from 'types/network';
-import './FeeSummary.scss';
-import { getScheduleGasLimit, getTimeBounty, getSchedulingToggle } from 'selectors/schedule';
import { calcEACTotalCost } from 'libs/scheduling';
+import { AppState } from 'features/reducers';
+import { getOffline, getNetworkConfig } from 'features/config';
+import { gasSelectors } from 'features/gas';
+import { transactionFieldsSelectors } from 'features/transaction';
+import { scheduleSelectors } from 'features/schedule';
+import { UnitDisplay, Spinner } from 'components/ui';
+import './FeeSummary.scss';
export interface RenderData {
gasPriceWei: string;
@@ -143,14 +144,14 @@ class FeeSummary extends React.Component {
function mapStateToProps(state: AppState): ReduxStateProps {
return {
- gasLimit: getGasLimit(state),
+ gasLimit: transactionFieldsSelectors.getGasLimit(state),
rates: state.rates.rates,
network: getNetworkConfig(state),
isOffline: getOffline(state),
- isGasEstimating: getIsEstimating(state),
- scheduling: getSchedulingToggle(state).value,
- scheduleGasLimit: getScheduleGasLimit(state),
- timeBounty: getTimeBounty(state)
+ isGasEstimating: gasSelectors.getIsEstimating(state),
+ scheduling: scheduleSelectors.getSchedulingToggle(state).value,
+ scheduleGasLimit: scheduleSelectors.getScheduleGasLimit(state),
+ timeBounty: scheduleSelectors.getTimeBounty(state)
};
}
diff --git a/common/components/TXMetaDataPanel/components/SimpleGas.tsx b/common/components/TXMetaDataPanel/components/SimpleGas.tsx
index 84d065d0..02b407ac 100644
--- a/common/components/TXMetaDataPanel/components/SimpleGas.tsx
+++ b/common/components/TXMetaDataPanel/components/SimpleGas.tsx
@@ -1,29 +1,24 @@
import React from 'react';
-import Slider, { createSliderWithTooltip } from 'rc-slider';
-import translate from 'translations';
-import './SimpleGas.scss';
-import { AppState } from 'reducers';
-import {
- getGasLimitEstimationTimedOut,
- getGasEstimationPending,
- nonceRequestPending
-} from 'selectors/transaction';
import { connect } from 'react-redux';
-import { fetchGasEstimates, TFetchGasEstimates } from 'actions/gas';
-import { getIsWeb3Node } from 'selectors/config';
-import { getEstimates, getIsEstimating } from 'selectors/gas';
-import { Wei, fromWei } from 'libs/units';
+import Slider, { createSliderWithTooltip } from 'rc-slider';
+
import { gasPriceDefaults } from 'config';
+import translate from 'translations';
+import { Wei, fromWei } from 'libs/units';
+import { AppState } from 'features/reducers';
+import { getIsWeb3Node } from 'features/config';
+import { transactionFieldsActions, transactionNetworkSelectors } from 'features/transaction';
+import { gasActions, gasSelectors } from 'features/gas';
+import { scheduleSelectors } from 'features/schedule';
import { InlineSpinner } from 'components/ui/InlineSpinner';
-import { TInputGasPrice } from 'actions/transaction';
import FeeSummary from './FeeSummary';
-import { getScheduleGasPrice } from 'selectors/schedule';
+import './SimpleGas.scss';
const SliderWithTooltip = createSliderWithTooltip(Slider);
interface OwnProps {
gasPrice: AppState['transaction']['fields']['gasPrice'];
- setGasPrice: TInputGasPrice;
+ setGasPrice: transactionFieldsActions.TInputGasPrice;
inputGasPrice(rawGas: string): void;
}
@@ -39,7 +34,7 @@ interface StateProps {
}
interface ActionProps {
- fetchGasEstimates: TFetchGasEstimates;
+ fetchGasEstimates: gasActions.TFetchGasEstimates;
}
type Props = OwnProps & StateProps & ActionProps;
@@ -152,15 +147,15 @@ class SimpleGas extends React.Component {
export default connect(
(state: AppState): StateProps => ({
- gasEstimates: getEstimates(state),
- isGasEstimating: getIsEstimating(state),
- noncePending: nonceRequestPending(state),
- gasLimitPending: getGasEstimationPending(state),
- gasLimitEstimationTimedOut: getGasLimitEstimationTimedOut(state),
+ gasEstimates: gasSelectors.getEstimates(state),
+ isGasEstimating: gasSelectors.getIsEstimating(state),
+ noncePending: transactionNetworkSelectors.nonceRequestPending(state),
+ gasLimitPending: transactionNetworkSelectors.getGasEstimationPending(state),
+ gasLimitEstimationTimedOut: transactionNetworkSelectors.getGasLimitEstimationTimedOut(state),
isWeb3Node: getIsWeb3Node(state),
- scheduleGasPrice: getScheduleGasPrice(state)
+ scheduleGasPrice: scheduleSelectors.getScheduleGasPrice(state)
}),
{
- fetchGasEstimates
+ fetchGasEstimates: gasActions.fetchGasEstimates
}
)(SimpleGas);
diff --git a/common/components/TXMetaDataPanel/index.tsx b/common/components/TXMetaDataPanel/index.tsx
index eed93731..7f68f3ca 100644
--- a/common/components/TXMetaDataPanel/index.tsx
+++ b/common/components/TXMetaDataPanel/index.tsx
@@ -1,2 +1 @@
-import TXMetaDataPanel from './TXMetaDataPanel';
-export default TXMetaDataPanel;
+export { default } from './TXMetaDataPanel';
diff --git a/common/components/TogglablePassword.tsx b/common/components/TogglablePassword.tsx
index 4c2aa657..a5c25eba 100644
--- a/common/components/TogglablePassword.tsx
+++ b/common/components/TogglablePassword.tsx
@@ -3,8 +3,9 @@
// Pass `isVisible` and `handleToggleVisibility` to control the visibility
// yourself, otherwise all visibiility changes are managed in internal state.
import React from 'react';
-import './TogglablePassword.scss';
+
import { Input, TextArea } from 'components/ui';
+import './TogglablePassword.scss';
interface Props {
// Shared props
diff --git a/common/components/TransactionStatus/TransactionDataTable.tsx b/common/components/TransactionStatus/TransactionDataTable.tsx
index ff9cd069..158b950e 100644
--- a/common/components/TransactionStatus/TransactionDataTable.tsx
+++ b/common/components/TransactionStatus/TransactionDataTable.tsx
@@ -1,8 +1,9 @@
import React from 'react';
+
import translate from 'translations';
-import { Identicon, UnitDisplay, NewTabLink, Address, CodeBlock } from 'components/ui';
import { TransactionData, TransactionReceipt } from 'types/transactions';
import { NetworkConfig } from 'types/network';
+import { Identicon, UnitDisplay, NewTabLink, Address, CodeBlock } from 'components/ui';
import './TransactionDataTable.scss';
interface TableRow {
diff --git a/common/components/TransactionStatus/TransactionStatus.tsx b/common/components/TransactionStatus/TransactionStatus.tsx
index 13f417a5..247b4c1b 100644
--- a/common/components/TransactionStatus/TransactionStatus.tsx
+++ b/common/components/TransactionStatus/TransactionStatus.tsx
@@ -1,14 +1,14 @@
import React from 'react';
import { connect } from 'react-redux';
+
import translate from 'translations';
-import { fetchTransactionData, TFetchTransactionData } from 'actions/transactions';
-import { getTransactionDatas } from 'selectors/transactions';
-import { getNetworkConfig } from 'selectors/config';
-import { Spinner } from 'components/ui';
-import TransactionDataTable from './TransactionDataTable';
-import { AppState } from 'reducers';
import { NetworkConfig } from 'types/network';
import { TransactionState } from 'types/transactions';
+import { AppState } from 'features/reducers';
+import { getNetworkConfig } from 'features/config';
+import { transactionsActions, transactionsSelectors } from 'features/transactions';
+import { Spinner } from 'components/ui';
+import TransactionDataTable from './TransactionDataTable';
import './TransactionStatus.scss';
interface OwnProps {
@@ -21,7 +21,7 @@ interface StateProps {
}
interface ActionProps {
- fetchTransactionData: TFetchTransactionData;
+ fetchTransactionData: transactionsActions.TFetchTransactionData;
}
type Props = OwnProps & StateProps & ActionProps;
@@ -79,9 +79,11 @@ function mapStateToProps(state: AppState, ownProps: OwnProps): StateProps {
const { txHash } = ownProps;
return {
- tx: getTransactionDatas(state)[txHash],
+ tx: transactionsSelectors.getTransactionDatas(state)[txHash],
network: getNetworkConfig(state)
};
}
-export default connect(mapStateToProps, { fetchTransactionData })(TransactionStatus);
+export default connect(mapStateToProps, {
+ fetchTransactionData: transactionsActions.fetchTransactionData
+})(TransactionStatus);
diff --git a/common/components/TransactionStatus/index.tsx b/common/components/TransactionStatus/index.tsx
index ae3b19f8..d0d15c43 100644
--- a/common/components/TransactionStatus/index.tsx
+++ b/common/components/TransactionStatus/index.tsx
@@ -1,2 +1 @@
-import TransactionStatus from './TransactionStatus';
-export default TransactionStatus;
+export { default } from './TransactionStatus';
diff --git a/common/components/Translate.tsx b/common/components/Translate.tsx
index ca35d3c8..30a72f64 100644
--- a/common/components/Translate.tsx
+++ b/common/components/Translate.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import Markdown from 'react-markdown';
+
import NewTabLink from 'components/ui/NewTabLink';
interface Props {
diff --git a/common/components/UnitDropDown/UnitDropDown.tsx b/common/components/UnitDropDown/UnitDropDown.tsx
index 0bad9e2e..ef64e621 100644
--- a/common/components/UnitDropDown/UnitDropDown.tsx
+++ b/common/components/UnitDropDown/UnitDropDown.tsx
@@ -1,22 +1,23 @@
import React, { Component } from 'react';
-import { setUnitMeta, TSetUnitMeta } from 'actions/transaction';
-import { TokenBalance, MergedToken, getShownTokenBalances, getTokens } from 'selectors/wallet';
-import { Query } from 'components/renderCbs';
import { connect } from 'react-redux';
-import { AppState } from 'reducers';
-import { getUnit } from 'selectors/transaction';
-import { getNetworkUnit } from 'selectors/config';
import { Option } from 'react-select';
+
+import { AppState } from 'features/reducers';
+import * as selectors from 'features/selectors';
+import { transactionMetaActions } from 'features/transaction';
+import { getNetworkUnit } from 'features/config';
+import { walletTypes } from 'features/wallet';
+import { Query } from 'components/renderCbs';
import { Dropdown } from 'components/ui';
interface DispatchProps {
- setUnitMeta: TSetUnitMeta;
+ setUnitMeta: transactionMetaActions.TSetUnitMeta;
}
interface StateProps {
unit: string;
- tokens: TokenBalance[];
- allTokens: MergedToken[];
+ tokens: walletTypes.TokenBalance[];
+ allTokens: walletTypes.MergedToken[];
showAllTokens?: boolean;
networkUnit: string;
}
@@ -49,15 +50,18 @@ class UnitDropdownClass extends Component {
this.props.setUnitMeta(unit.value);
};
}
-const getTokenSymbols = (tokens: (TokenBalance | MergedToken)[]) => tokens.map(t => t.symbol);
+const getTokenSymbols = (tokens: (walletTypes.TokenBalance | walletTypes.MergedToken)[]) =>
+ tokens.map(t => t.symbol);
function mapStateToProps(state: AppState) {
return {
- tokens: getShownTokenBalances(state, true),
- allTokens: getTokens(state),
- unit: getUnit(state),
+ tokens: selectors.getShownTokenBalances(state, true),
+ allTokens: selectors.getTokens(state),
+ unit: selectors.getUnit(state),
networkUnit: getNetworkUnit(state)
};
}
-export const UnitDropDown = connect(mapStateToProps, { setUnitMeta })(UnitDropdownClass);
+export const UnitDropDown = connect(mapStateToProps, {
+ setUnitMeta: transactionMetaActions.setUnitMeta
+})(UnitDropdownClass);
diff --git a/common/components/WalletDecrypt/WalletDecrypt.scss b/common/components/WalletDecrypt/WalletDecrypt.scss
index 6d9bb4f9..1bf6486d 100644
--- a/common/components/WalletDecrypt/WalletDecrypt.scss
+++ b/common/components/WalletDecrypt/WalletDecrypt.scss
@@ -103,7 +103,7 @@ $speed: 500ms;
max-width: 360px;
margin: 0 auto;
}
- &-label{
+ &-label {
opacity: 0.8;
font-weight: 300;
white-space: nowrap;
@@ -111,6 +111,17 @@ $speed: 500ms;
overflow: hidden;
text-overflow: ellipsis;
}
+
+ &-override {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ opacity: 0.3;
+
+ &:hover {
+ opacity: 1;
+ }
+ }
}
}
diff --git a/common/components/WalletDecrypt/WalletDecrypt.tsx b/common/components/WalletDecrypt/WalletDecrypt.tsx
index 041731b0..daa30b1e 100644
--- a/common/components/WalletDecrypt/WalletDecrypt.tsx
+++ b/common/components/WalletDecrypt/WalletDecrypt.tsx
@@ -1,22 +1,32 @@
import React, { Component } from 'react';
+import { TransitionGroup, CSSTransition } from 'react-transition-group';
+import { withRouter, RouteComponentProps } from 'react-router';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import isEmpty from 'lodash/isEmpty';
-import { TransitionGroup, CSSTransition } from 'react-transition-group';
+
import {
- setWallet,
- TSetWallet,
- unlockKeystore,
- TUnlockKeystore,
- unlockMnemonic,
- TUnlockMnemonic,
- unlockPrivateKey,
- TUnlockPrivateKey,
- unlockWeb3,
- TUnlockWeb3
-} from 'actions/wallet';
-import { resetTransactionRequested, TResetTransactionRequested } from 'actions/transaction';
+ SecureWalletName,
+ InsecureWalletName,
+ MiscWalletName,
+ WalletName,
+ knowledgeBaseURL,
+ donationAddressMap
+} from 'config';
import translate, { translateRaw } from 'translations';
+import { isWeb3NodeAvailable } from 'libs/nodes/web3';
+import { wikiLink as paritySignerHelpLink } from 'libs/wallet/non-deterministic/parity';
+import { AppState } from 'features/reducers';
+import * as derivedSelectors from 'features/selectors';
+import { walletActions } from 'features/wallet';
+import { transactionFieldsActions } from 'features/transaction';
+import { notificationsActions } from 'features/notifications';
+import LedgerIcon from 'assets/images/wallets/ledger.svg';
+import TrezorIcon from 'assets/images/wallets/trezor.svg';
+import ParitySignerIcon from 'assets/images/wallets/parity-signer.svg';
+import { Errorable } from 'components';
+import { DisabledWallets } from './disables';
+import { getWeb3ProviderInfo } from 'utils/web3';
import {
KeystoreDecrypt,
LedgerNanoSDecrypt,
@@ -30,27 +40,7 @@ import {
ParitySignerDecrypt,
InsecureWalletWarning
} from './components';
-import { AppState } from 'reducers';
-import { showNotification, TShowNotification } from 'actions/notifications';
-import { getDisabledWallets } from 'selectors/wallet';
-import { DisabledWallets } from './disables';
-import {
- SecureWalletName,
- InsecureWalletName,
- MiscWalletName,
- WalletName,
- knowledgeBaseURL,
- donationAddressMap
-} from 'config';
-import { isWeb3NodeAvailable } from 'libs/nodes/web3';
-import { getWeb3ProviderInfo } from 'utils/web3';
-import LedgerIcon from 'assets/images/wallets/ledger.svg';
-import TrezorIcon from 'assets/images/wallets/trezor.svg';
-import ParitySignerIcon from 'assets/images/wallets/parity-signer.svg';
-import { wikiLink as paritySignerHelpLink } from 'libs/wallet/non-deterministic/parity';
import './WalletDecrypt.scss';
-import { withRouter, RouteComponentProps } from 'react-router';
-import { Errorable } from 'components';
interface OwnProps {
hidden?: boolean;
@@ -59,13 +49,13 @@ interface OwnProps {
}
interface DispatchProps {
- unlockKeystore: TUnlockKeystore;
- unlockMnemonic: TUnlockMnemonic;
- unlockPrivateKey: TUnlockPrivateKey;
- unlockWeb3: TUnlockWeb3;
- setWallet: TSetWallet;
- resetTransactionRequested: TResetTransactionRequested;
- showNotification: TShowNotification;
+ unlockKeystore: walletActions.TUnlockKeystore;
+ unlockMnemonic: walletActions.TUnlockMnemonic;
+ unlockPrivateKey: walletActions.TUnlockPrivateKey;
+ unlockWeb3: walletActions.TUnlockWeb3;
+ setWallet: walletActions.TSetWallet;
+ resetTransactionRequested: transactionFieldsActions.TResetTransactionRequested;
+ showNotification: notificationsActions.TShowNotification;
}
interface StateProps {
@@ -79,8 +69,8 @@ type Props = OwnProps & StateProps & DispatchProps & RouteComponentProps<{}>;
type UnlockParams = {} | PrivateKeyValue;
interface State {
selectedWalletKey: WalletName | null;
+ isInsecureOverridden: boolean;
value: UnlockParams | null;
- hasAcknowledgedInsecure: boolean;
}
interface BaseWalletInfo {
@@ -204,8 +194,8 @@ const WalletDecrypt = withRouter(
public state: State = {
selectedWalletKey: null,
- value: null,
- hasAcknowledgedInsecure: false
+ isInsecureOverridden: false,
+ value: null
};
public UNSAFE_componentWillReceiveProps(nextProps: Props) {
@@ -228,20 +218,28 @@ const WalletDecrypt = withRouter(
}
public getDecryptionComponent() {
- const { selectedWalletKey, hasAcknowledgedInsecure } = this.state;
+ const { selectedWalletKey, isInsecureOverridden } = this.state;
const selectedWallet = this.getSelectedWallet();
if (!selectedWalletKey || !selectedWallet) {
return null;
}
- if (INSECURE_WALLETS.includes(selectedWalletKey) && !hasAcknowledgedInsecure) {
+ const isInsecure = INSECURE_WALLETS.includes(selectedWalletKey);
+ if (isInsecure && !isInsecureOverridden && !process.env.BUILD_DOWNLOADABLE) {
return (
+ {process.env.NODE_ENV !== 'production' && (
+
+ )}
);
}
@@ -289,10 +287,6 @@ const WalletDecrypt = withRouter(
);
}
- public handleAcknowledgeInsecure = () => {
- this.setState({ hasAcknowledgedInsecure: true });
- };
-
public buildWalletOptions() {
const { computedDisabledWallets } = this.props;
const { reasons } = computedDisabledWallets;
@@ -386,8 +380,7 @@ const WalletDecrypt = withRouter(
window.setTimeout(() => {
this.setState({
selectedWalletKey: walletType,
- value: wallet.initialParams,
- hasAcknowledgedInsecure: false
+ value: wallet.initialParams
});
}, timeout);
};
@@ -395,8 +388,7 @@ const WalletDecrypt = withRouter(
public clearWalletChoice = () => {
this.setState({
selectedWalletKey: null,
- value: null,
- hasAcknowledgedInsecure: false
+ value: null
});
};
@@ -448,12 +440,18 @@ const WalletDecrypt = withRouter(
private isWalletDisabled = (walletKey: WalletName) => {
return this.props.computedDisabledWallets.wallets.indexOf(walletKey) !== -1;
};
+
+ private overrideInsecureWarning = () => {
+ if (process.env.NODE_ENV !== 'production') {
+ this.setState({ isInsecureOverridden: true });
+ }
+ };
}
);
function mapStateToProps(state: AppState, ownProps: Props) {
const { disabledWallets } = ownProps;
- let computedDisabledWallets = getDisabledWallets(state);
+ let computedDisabledWallets = derivedSelectors.getDisabledWallets(state);
if (disabledWallets) {
computedDisabledWallets = {
@@ -473,11 +471,11 @@ function mapStateToProps(state: AppState, ownProps: Props) {
}
export default connect(mapStateToProps, {
- unlockKeystore,
- unlockMnemonic,
- unlockPrivateKey,
- unlockWeb3,
- setWallet,
- resetTransactionRequested,
- showNotification
+ unlockKeystore: walletActions.unlockKeystore,
+ unlockMnemonic: walletActions.unlockMnemonic,
+ unlockPrivateKey: walletActions.unlockPrivateKey,
+ unlockWeb3: walletActions.unlockWeb3,
+ setWallet: walletActions.setWallet,
+ resetTransactionRequested: transactionFieldsActions.resetTransactionRequested,
+ showNotification: notificationsActions.showNotification
})(WalletDecrypt) as React.ComponentClass;
diff --git a/common/components/WalletDecrypt/components/DeprecationWarning.tsx b/common/components/WalletDecrypt/components/DeprecationWarning.tsx
deleted file mode 100644
index 82eab917..00000000
--- a/common/components/WalletDecrypt/components/DeprecationWarning.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-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/DeterministicWalletsModal.tsx b/common/components/WalletDecrypt/components/DeterministicWalletsModal.tsx
index 67b046ce..43c0da2a 100644
--- a/common/components/WalletDecrypt/components/DeterministicWalletsModal.tsx
+++ b/common/components/WalletDecrypt/components/DeterministicWalletsModal.tsx
@@ -1,23 +1,19 @@
import React from 'react';
-import { connect } from 'react-redux';
import Select, { Option } from 'react-select';
-import { toChecksumAddress } from 'ethereumjs-util';
+import { connect } from 'react-redux';
+
import translate, { translateRaw } from 'translations';
-import {
- DeterministicWalletData,
- getDeterministicWallets,
- GetDeterministicWalletsAction,
- GetDeterministicWalletsArgs,
- setDesiredToken,
- SetDesiredTokenAction
-} from 'actions/deterministicWallets';
-import Modal, { IButton } from 'components/ui/Modal';
-import { AppState } from 'reducers';
import { isValidPath } from 'libs/validators';
-import { getNetworkConfig } from 'selectors/config';
-import { getTokens } from 'selectors/wallet';
-import { getAddressLabels } from 'selectors/addressBook';
+import { AppState } from 'features/reducers';
+import { getNetworkConfig } from 'features/config';
+import * as selectors from 'features/selectors';
+import {
+ deterministicWalletsTypes,
+ deterministicWalletsActions
+} from 'features/deterministicWallets';
+import { addressBookSelectors } from 'features/addressBook';
import { UnitDisplay, Input } from 'components/ui';
+import Modal, { IButton } from 'components/ui/Modal';
import './DeterministicWalletsModal.scss';
const WALLETS_PER_PAGE = 5;
@@ -32,16 +28,18 @@ interface OwnProps {
}
interface StateProps {
- addressLabels: ReturnType;
+ addressLabels: ReturnType;
wallets: AppState['deterministicWallets']['wallets'];
desiredToken: AppState['deterministicWallets']['desiredToken'];
network: ReturnType;
- tokens: ReturnType;
+ tokens: ReturnType;
}
interface DispatchProps {
- getDeterministicWallets(args: GetDeterministicWalletsArgs): GetDeterministicWalletsAction;
- setDesiredToken(tkn: string | undefined): SetDesiredTokenAction;
+ getDeterministicWallets(
+ args: deterministicWalletsTypes.GetDeterministicWalletsArgs
+ ): deterministicWalletsTypes.GetDeterministicWalletsAction;
+ setDesiredToken(tkn: string | undefined): deterministicWalletsTypes.SetDesiredTokenAction;
onCancel(): void;
onConfirmAddress(address: string, addressIndex: number): void;
onPathChange(dPath: DPath): void;
@@ -201,14 +199,13 @@ class DeterministicWalletsModalClass extends React.PureComponent {
private getAddresses(props: Props = this.props) {
const { dPath, publicKey, chainCode, seed } = props;
-
if (dPath && ((publicKey && chainCode) || seed)) {
if (isValidPath(dPath.value)) {
this.props.getDeterministicWallets({
seed,
+ dPath: dPath.value,
publicKey,
chainCode,
- dPath: dPath.value,
limit: WALLETS_PER_PAGE,
offset: WALLETS_PER_PAGE * this.state.page
});
@@ -277,10 +274,10 @@ class DeterministicWalletsModalClass extends React.PureComponent {
);
}
- private renderWalletRow(wallet: DeterministicWalletData) {
+ private renderWalletRow(wallet: deterministicWalletsTypes.DeterministicWalletData) {
const { desiredToken, network, addressLabels } = this.props;
const { selectedAddress } = this.state;
- const label = addressLabels[toChecksumAddress(wallet.address)];
+ const label = addressLabels[wallet.address.toLowerCase()];
const spanClassName = label ? 'DWModal-addresses-table-address-text' : '';
// Get renderable values, but keep 'em short
@@ -342,17 +339,17 @@ class DeterministicWalletsModalClass extends React.PureComponent {
function mapStateToProps(state: AppState): StateProps {
return {
- addressLabels: getAddressLabels(state),
+ addressLabels: addressBookSelectors.getAddressLabels(state),
wallets: state.deterministicWallets.wallets,
desiredToken: state.deterministicWallets.desiredToken,
network: getNetworkConfig(state),
- tokens: getTokens(state)
+ tokens: selectors.getTokens(state)
};
}
const DeterministicWalletsModal = connect(mapStateToProps, {
- getDeterministicWallets,
- setDesiredToken
+ getDeterministicWallets: deterministicWalletsActions.getDeterministicWallets,
+ setDesiredToken: deterministicWalletsActions.setDesiredToken
})(DeterministicWalletsModalClass);
export default DeterministicWalletsModal;
diff --git a/common/components/WalletDecrypt/components/InsecureWalletWarning.scss b/common/components/WalletDecrypt/components/InsecureWalletWarning.scss
index d93742a9..0cb476c1 100644
--- a/common/components/WalletDecrypt/components/InsecureWalletWarning.scss
+++ b/common/components/WalletDecrypt/components/InsecureWalletWarning.scss
@@ -1,36 +1,48 @@
@import 'common/sass/variables';
+@import 'common/sass/mixins';
.WalletWarning {
- max-width: 780px;
+ max-width: 820px;
margin: 0 auto;
- text-align: left;
+ text-align: center;
&-title {
color: $brand-danger;
- margin-top: 0;
+ margin: 0 0 $space;
}
&-desc {
- margin-bottom: $space;
- }
-
- &-check {
- margin-bottom: $space * 2;
- }
-
- &-checkboxes {
margin-bottom: $space * 2;
}
&-buttons {
display: flex;
+ flex-direction: column;
flex-wrap: wrap;
- margin-bottom: -$space-sm;
+ justify-content: center;
+ max-width: 440px;
+ margin: 0 auto #{-$space};
- .btn {
- flex: 1;
- min-width: 280px;
- margin: 0 $space-sm $space-sm;
+ &-btn {
+ width: 100%;
+ margin: 0 0 $space;
+
+ &.is-cancel {
+ @include reset-button;
+ opacity: 0.4;
+ transition: $transition;
+
+ &:hover {
+ opacity: 1;
+ }
+
+ .fa {
+ position: relative;
+ top: -1px;
+ margin-right: $space-xs;
+ font-size: 11px;
+ }
+ }
}
}
}
@@ -38,7 +50,7 @@
.AcknowledgeCheckbox {
margin-bottom: $space-sm;
- &-checkbox[type="checkbox"] {
+ &-checkbox[type='checkbox'] {
display: inline-block;
margin-right: $space-sm;
margin-top: 0;
diff --git a/common/components/WalletDecrypt/components/InsecureWalletWarning.tsx b/common/components/WalletDecrypt/components/InsecureWalletWarning.tsx
index d1d32845..f24abef6 100644
--- a/common/components/WalletDecrypt/components/InsecureWalletWarning.tsx
+++ b/common/components/WalletDecrypt/components/InsecureWalletWarning.tsx
@@ -1,129 +1,43 @@
import React from 'react';
-import { HELP_ARTICLE, DOWNLOAD_MYCRYPTO_LINK } from 'config';
-import './InsecureWalletWarning.scss';
import translate from 'translations';
-import { knowledgeBaseURL } from 'config/data';
+import { NewTabLink } from 'components/ui';
+import './InsecureWalletWarning.scss';
interface Props {
walletType: string;
- onContinue(): void;
onCancel(): void;
}
-interface State {
- hasConfirmedSite: boolean;
- hasAcknowledgedDownload: boolean;
- hasAcknowledgedWallets: boolean;
-}
-
-interface Checkbox {
- name: keyof State;
- label: string | React.ReactElement;
-}
-
-export class InsecureWalletWarning extends React.Component {
- public state: State = {
- hasConfirmedSite: false,
- hasAcknowledgedDownload: false,
- hasAcknowledgedWallets: false
- };
-
+export class InsecureWalletWarning extends React.Component {
constructor(props: Props) {
super(props);
- if (process.env.BUILD_DOWNLOADABLE) {
- props.onContinue();
- }
}
public render() {
- if (process.env.BUILD_DOWNLOADABLE) {
- return null;
- }
-
- const { walletType, onContinue, onCancel } = this.props;
- const checkboxes: Checkbox[] = [
- {
- name: 'hasAcknowledgedWallets',
- label: translate('INSECURE_WALLET_WARNING_1')
- },
- {
- name: 'hasAcknowledgedDownload',
- label: translate('INSECURE_WALLET_WARNING_2')
- },
- {
- name: 'hasConfirmedSite',
- label: translate('INSECURE_WALLET_WARNING_3')
- }
- ];
- const canContinue = checkboxes.reduce(
- (prev, checkbox) => prev && this.state[checkbox.name],
- true
- );
+ const { walletType, onCancel } = this.props;
return (
-
{translate('INSECURE_WALLET_TYPE_TITLE')}
+
+ {translate('INSECURE_WALLET_TYPE_TITLE', { $wallet_type: walletType })}
+
{translate('INSECURE_WALLET_TYPE_DESC', { $wallet_type: walletType })}
-
- -
- {translate('INSECURE_WALLET_RECOMMEND_1', {
- $metamask_article: knowledgeBaseURL + '/' + HELP_ARTICLE.MIGRATE_TO_METAMASK,
- $hardware_wallet_article:
- knowledgeBaseURL + '/' + HELP_ARTICLE.HARDWARE_WALLET_RECOMMENDATIONS
- })}
-
- -
- {translate('INSECURE_WALLET_RECOMMEND_2', {
- $download_mycrypto: DOWNLOAD_MYCRYPTO_LINK
- })}
-
- -
- {translate('INSECURE_WALLET_RECOMMEND_3', {
- $secure_your_eth_article: knowledgeBaseURL + '/' + HELP_ARTICLE.SECURING_YOUR_ETH
- })}
-
-
-
- {translate('WALLET_WARNING_CHECK', { $wallet_type: walletType })}
-
-
{checkboxes.map(this.makeCheckbox)}
-
-
);
}
-
- private makeCheckbox = (checkbox: Checkbox) => {
- return (
-
- );
- };
-
- private handleCheckboxChange = (ev: React.FormEvent) => {
- this.setState({
- [ev.currentTarget.name as any]: !!ev.currentTarget.checked
- });
- };
}
diff --git a/common/components/WalletDecrypt/components/Keystore.tsx b/common/components/WalletDecrypt/components/Keystore.tsx
index 1705f28e..44156d51 100644
--- a/common/components/WalletDecrypt/components/Keystore.tsx
+++ b/common/components/WalletDecrypt/components/Keystore.tsx
@@ -1,10 +1,10 @@
-import { isKeystorePassRequired } from 'libs/wallet';
import React, { PureComponent } from 'react';
+
import translate, { translateRaw } from 'translations';
+import { isKeystorePassRequired } from 'libs/wallet';
+import { notificationsActions } from 'features/notifications';
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;
@@ -35,7 +35,7 @@ export class KeystoreDecrypt extends PureComponent {
isPasswordPending: boolean;
onChange(value: KeystoreValue): void;
onUnlock(): void;
- showNotification(level: string, message: string): TShowNotification;
+ showNotification(level: string, message: string): notificationsActions.TShowNotification;
};
public render() {
@@ -45,7 +45,6 @@ export class KeystoreDecrypt extends PureComponent {
return (