From 7c852b30b8313a3234394c633855d882cd0512cd Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 19 Apr 2019 17:15:41 -0400 Subject: [PATCH] add back invite guide --- src/ui/component/sideBar/index.js | 2 ++ src/ui/component/sideBar/view.jsx | 48 ++++++++++++++++--------- src/ui/redux/selectors/app.js | 8 +++++ src/ui/scss/all.scss | 1 - src/ui/scss/component/_banner.scss | 1 + src/ui/scss/component/_file-render.scss | 1 - src/ui/scss/component/_menu.scss | 10 ------ src/ui/scss/component/_navigation.scss | 4 +-- src/ui/scss/component/_tooltip.scss | 2 -- 9 files changed, 44 insertions(+), 33 deletions(-) delete mode 100644 src/ui/scss/component/_menu.scss 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 (