import React, { Component } from 'react'; import { connect } from 'react-redux'; import classnames from 'classnames'; import WalletDecrypt, { DISABLE_WALLETS } from 'components/WalletDecrypt'; import translate from 'translations'; import { showNotification, TShowNotification } from 'actions/notifications'; import { resetWallet, TResetWallet } from 'actions/wallet'; import { ISignedMessage } from 'libs/signing'; import { IFullWallet } from 'libs/wallet'; import { AppState } from 'reducers'; import SignButton from './SignButton'; import { isWalletFullyUnlocked } from 'selectors/wallet'; import './index.scss'; interface Props { wallet: IFullWallet; unlocked: boolean; showNotification: TShowNotification; resetWallet: TResetWallet; } interface State { message: string; signedMessage: ISignedMessage | null; } const initialState: State = { message: '', signedMessage: null }; const messagePlaceholder = 'This is a sweet message that you are signing to prove that you own the address you say you own.'; export class SignMessage extends Component { public state: State = initialState; public componentWillUnmount() { this.props.resetWallet(); } public render() { const { wallet, unlocked } = this.props; const { message, signedMessage } = this.state; const messageBoxClass = classnames([ 'SignMessage-inputBox', 'form-control', message ? 'is-valid' : 'is-invalid' ]); return (
{unlocked ? (

{translate('MSG_message')}