import React from 'react';
import { RouteComponentProps, Route, Switch, Redirect } from 'react-router';
import { connect } from 'react-redux';
import translate from 'translations';
import { AppState } from 'features/reducers';
import { isNetworkUnit } from 'features/config';
import { walletSelectors } from 'features/wallet';
import TabSection from 'containers/TabSection';
import { RedirectWithQuery } from 'components/RedirectWithQuery';
import { UnlockHeader } from 'components/ui';
import SubTabs, { Tab } from 'components/SubTabs';
import { RouteNotFound } from 'components/RouteNotFound';
import {
WalletInfo,
RequestPayment,
RecentTransactions,
AddressBook,
Fields,
UnavailableWallets,
SideBar
} from './components';
const Send = () => (
);
interface StateProps {
wallet: AppState['wallet']['inst'];
requestDisabled: boolean;
}
type Props = StateProps & RouteComponentProps<{}>;
class SendTransaction extends React.Component {
public render() {
const { wallet, match, location, history } = this.props;
const currentPath = match.url;
const tabs: Tab[] = [
{
path: 'send',
name: translate('NAV_SENDETHER'),
disabled: !!wallet && !!wallet.isReadOnly
},
{
path: 'request',
name: translate('NAV_REQUESTPAYMENT'),
disabled: this.props.requestDisabled
},
{
path: 'info',
name: translate('NAV_VIEWWALLET')
},
{
path: 'recent-txs',
name: translate('NAV_RECENT_TX')
},
{
path: 'address-book',
name: translate('NAV_ADDRESS_BOOK')
}
];
return (
{wallet && (
(
)}
/>
{
return wallet.isReadOnly ? : ;
}}
/>
}
/>
}
/>
}
/>
}
/>
)}
);
}
}
export default connect((state: AppState) => ({
wallet: walletSelectors.getWalletInst(state),
requestDisabled: !isNetworkUnit(state, 'ETH')
}))(SendTransaction);