diff --git a/src/views/Wallet/components/TopNavigationAccount/index.js b/src/views/Wallet/components/TopNavigationAccount/index.js index ecbd0776..492f608f 100644 --- a/src/views/Wallet/components/TopNavigationAccount/index.js +++ b/src/views/Wallet/components/TopNavigationAccount/index.js @@ -4,14 +4,15 @@ import styled from 'styled-components'; import React from 'react'; import { FONT_SIZE, FONT_WEIGHT } from 'config/variables'; import { NavLink } from 'react-router-dom'; +import { connect } from 'react-redux'; import colors from 'config/colors'; - -import type { Location } from 'react-router'; +import type { State } from 'flowtype'; import Indicator from './components/Indicator'; type Props = { - location: Location; + router: $ElementType, + selectedAccount: $ElementType, }; const Wrapper = styled.div` @@ -56,20 +57,39 @@ class TopNavigationAccount extends React.PureComponent { wrapper: ?HTMLElement; render() { - const { state, pathname } = this.props.location; + const { state, pathname } = this.props.router.location; if (!state) return null; + const { network } = this.props.selectedAccount; + if (!network) return null; const basePath = `/device/${state.device}/network/${state.network}/account/${state.account}`; - return ( - - Summary - Receive - Send - Sign & Verify - this.wrapper} /> - - ); + + switch (network.type) { + case 'ethereum': + return ( + + Summary + Receive + Send + Sign & Verify + this.wrapper} /> + + ); + case 'ripple': + return ( + + Summary + Receive + Send + this.wrapper} /> + + ); + default: return null; + } } } -export default TopNavigationAccount; \ No newline at end of file +export default connect((state: State): Props => ({ + router: state.router, + selectedAccount: state.selectedAccount, +}), null)(TopNavigationAccount); \ No newline at end of file