diff --git a/src/ui/component/sideBar/index.js b/src/ui/component/sideBar/index.js index 1e874f605..0b3b67846 100644 --- a/src/ui/component/sideBar/index.js +++ b/src/ui/component/sideBar/index.js @@ -1,9 +1,11 @@ import { connect } from 'react-redux'; import { selectUnreadAmount } from 'redux/selectors/subscriptions'; +import { selectShouldShowInviteGuide } from 'redux/selectors/app'; import SideBar from './view'; const select = state => ({ unreadSubscriptionTotal: selectUnreadAmount(state), + shouldShowInviteGuide: selectShouldShowInviteGuide(state), }); const perform = () => ({}); diff --git a/src/ui/component/sideBar/view.jsx b/src/ui/component/sideBar/view.jsx index af31ff32d..5a626a59d 100644 --- a/src/ui/component/sideBar/view.jsx +++ b/src/ui/component/sideBar/view.jsx @@ -6,37 +6,46 @@ import Button from 'component/button'; import classnames from 'classnames'; import Tooltip from 'component/common/tooltip'; -type SideBarLink = { - label: string, - path: string, - active: boolean, - icon: ?string, - subLinks: Array, - guide: ?string, -}; - type Props = { unreadSubscriptionTotal: number, + shouldShowInviteGuide: string, }; class SideBar extends React.PureComponent { render() { - const { unreadSubscriptionTotal } = this.props; - const buildLink = (path, label, icon) => ({ + const { unreadSubscriptionTotal, shouldShowInviteGuide } = this.props; + const buildLink = (path, label, icon, guide) => ({ navigate: path ? `$/${path}` : '/', label, icon, + guide, }); - const renderLink = (linkProps, index) => ( -
  • + const renderLink = (linkProps, index) => { + const { guide } = linkProps; + + const inner = (
  • - ); + ); + + return ( +
  • + {guide ? ( + + {inner} + + ) : ( + inner + )} +
  • + ); + }; return (