import React from 'react'; import { connect } from 'react-redux'; import { AppState } from 'features/reducers'; import { walletSelectors } from 'features/wallet'; import EquivalentValues from './EquivalentValues'; import AccountInfo from './AccountInfo'; import Promos from './Promos'; import TokenBalances from './TokenBalances'; interface Block { name: string; content: React.ReactElement; isFullWidth?: boolean; } interface StateProps { wallet: AppState['wallet']['inst']; } export class BalanceSidebar extends React.Component { public render() { const { wallet } = this.props; if (!wallet) { return null; } const blocks: Block[] = [ { name: 'Account Info', content: }, { name: 'Promos', isFullWidth: true, content: }, { name: 'Token Balances', content: }, { name: 'Equivalent Values', content: } ]; return ( ); } } const mapStateToProps = (state: AppState): StateProps => ({ wallet: walletSelectors.getWalletInst(state) }); export default connect(mapStateToProps)(BalanceSidebar);