mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 02:55:41 +00:00
5d3e461301
* Check in. * Add read only wallet and new types for that. Convert some components to require full wallet. * Fix readonly property, fix uncaught throw. * Disable address only on some tabs. * Use FullWalletOnly render callback to handle signing. * Work around uncertain wallet type. * Fix function args. * Undo bug fix that should be done in another branch. * Disable button while address is bad. * Remove log. * Convert anonymous functions to class functions.
28 lines
739 B
TypeScript
28 lines
739 B
TypeScript
import * as React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { AppState } from 'reducers';
|
|
import { IWallet, IFullWallet } from 'libs/wallet';
|
|
|
|
interface Props {
|
|
wallet: IWallet;
|
|
withFullWallet(wallet: IFullWallet): React.ReactElement<any>;
|
|
withoutFullWallet(): React.ReactElement<any>;
|
|
}
|
|
|
|
class FullWalletOnly extends React.Component<Props, {}> {
|
|
public render() {
|
|
const { wallet, withFullWallet, withoutFullWallet } = this.props;
|
|
if (!wallet || wallet.isReadOnly) {
|
|
if (withoutFullWallet) {
|
|
return withoutFullWallet();
|
|
}
|
|
return null;
|
|
}
|
|
return withFullWallet(wallet);
|
|
}
|
|
}
|
|
|
|
export default connect((state: AppState) => ({
|
|
wallet: state.wallet.inst
|
|
}))(FullWalletOnly);
|