import React from 'react'; import { translate } from '../../translate/translate'; import { copyCoinAddress, iguanaEdexBalance, toggleSendCoinForm, toggleReceiveCoinForm, toggleSendReceiveCoinForms, toggleDashboardActiveSection } from '../../actions/actionCreators'; import Store from '../../store'; class WalletsNav extends React.Component { constructor(props) { super(props); this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); } componentWillMount() { Store.dispatch(iguanaEdexBalance(this.props.ActiveCoin.coin)); } copyMyAddress(address) { Store.dispatch(copyCoinAddress(address)); } toggleSendReceiveCoinForms() { if (this.props.ActiveCoin.mode === 'native') { Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings')); } else { Store.dispatch(toggleSendReceiveCoinForms()); } } toggleSendCoinForm(display) { if (this.props.ActiveCoin.mode === 'native') { Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send')); } else { Store.dispatch(toggleSendCoinForm(display)); } } toggleReceiveCoinForm(display) { if (this.props.ActiveCoin.mode === 'native') { Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive')); } else { Store.dispatch(toggleReceiveCoinForm(display)); } } render() { if (this.props && this.props.ActiveCoin && !this.props.ActiveCoin.coin) { return (
{ translate('INDEX.NO_WALLET_CAPS') }
{ translate('INDEX.PLEASE_SELECT_A_WALLET') }.
); } else { return (
    { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' }
); } } } export default WalletsNav;