import { Query } from 'components/renderCbs'; import React, { Component } from 'react'; import { TokenValue, Wei } from 'libs/units'; import translate from 'translations'; import { connect } from 'react-redux'; import { sendEverythingRequested, TSendEverythingRequested } from 'actions/transaction'; import { getCurrentBalance } from 'selectors/wallet'; import { AppState } from 'reducers'; interface DispatchProps { sendEverythingRequested: TSendEverythingRequested; } interface StateProps { currentBalance: Wei | TokenValue | null; } type Props = StateProps & DispatchProps; class SendEverythingClass extends Component { public render() { if (!this.props.currentBalance) { return null; } return ( !readOnly ? ( {translate('SEND_TRANSFERTOTAL')} ) : null } /> ); } private onSendEverything = () => { this.props.sendEverythingRequested(); }; } export const SendEverything = connect( (state: AppState) => ({ currentBalance: getCurrentBalance(state) }), { sendEverythingRequested } )(SendEverythingClass);