Repository: busyorg/busy
Pull request #980 (2017-11-02 12:00:40)

Move `Replies` to main user sidebar navigation
Fixes # .
https://github.com/busyorg/busy/issues/979
Changes:
- Move replies to main user sidebar nav


Patch:
diff --git a/src/app/Sidebar/LeftSidebar.js b/src/app/Sidebar/LeftSidebar.js
index 549b158a..6899e048 100644
--- a/src/app/Sidebar/LeftSidebar.js
+++ b/src/app/Sidebar/LeftSidebar.js
@@ -10,7 +10,7 @@ const LeftSidebar = () => (
     <Route path="/@:name/wallet" component={Navigation} />
     <Route path="/@:name" component={UserInfo} />
     <Route path="/activity" component={NavigationUser} />
-    <Route path="/replies" component={NavigationUser} />
+    <Route path="/replies" component={Navigation} />
     <Route path="/bookmarks" component={NavigationUser} />
     <Route path="/drafts" component={NavigationUser} />
     <Route path="/edit-profile" component={NavigationUser} />
diff --git a/src/components/Navigation/Sidenav.js b/src/components/Navigation/Sidenav.js
index c18e049b..dc183c16 100644
--- a/src/components/Navigation/Sidenav.js
+++ b/src/components/Navigation/Sidenav.js
@@ -6,6 +6,7 @@ import './Sidenav.less';
 
 const isNews = (match, location) => location.pathname.match(/trending/);
 const isWallet = (match, location) => location.pathname.match(/wallet/);
+const isReplies = (match, location) => location.pathname.match(/replies/);
 
 const Sidenav = ({ username }) => (
   <div>
@@ -29,6 +30,12 @@ const Sidenav = ({ username }) => (
             <FormattedMessage id="news" defaultMessage="News" />
           </NavLink>
         </li>
+        <li>
+          <NavLink to="/replies" activeClassName="Sidenav__item--active" isActive={isReplies}>
+            <i className="iconfont icon-message" />
+            <FormattedMessage id="replies" defaultMessage="Replies" />
+          </NavLink>
+        </li>
         <li>
           <NavLink to="/wallet" activeClassName="Sidenav__item--active" isActive={isWallet}>
             <i className="iconfont icon-wallet" />
diff --git a/src/components/Navigation/SidenavUser.js b/src/components/Navigation/SidenavUser.js
index 3623e75a..cbd3fb7b 100644
--- a/src/components/Navigation/SidenavUser.js
+++ b/src/components/Navigation/SidenavUser.js
@@ -12,12 +12,6 @@ const SidenavUser = ({ username }) => (
         <FormattedMessage id="activity" defaultMessage="Activity" />
       </a>
     </li>
-    <li>
-      <NavLink to="/replies" activeClassName="Sidenav__item--active">
-        <i className="iconfont icon-message" />
-        <FormattedMessage id="replies" defaultMessage="Replies" />
-      </NavLink>
-    </li>
     <li>
       <NavLink to="/bookmarks" activeClassName="Sidenav__item--active">
         <i className="iconfont icon-collection" />
diff --git a/src/components/Navigation/Topnav.js b/src/components/Navigation/Topnav.js
index 4dbc6329..fc3d7b47 100644
--- a/src/components/Navigation/Topnav.js
+++ b/src/components/Navigation/Topnav.js
@@ -42,9 +42,6 @@ const Topnav = ({ intl, username, onMenuItemClick }) => {
                   <PopoverMenuItem key="activity">
                     <FormattedMessage id="activity" defaultMessage="Activity" />
                   </PopoverMenuItem>
-                  <PopoverMenuItem key="replies">
-                    <FormattedMessage id="replies" defaultMessage="Replies" />
-                  </PopoverMenuItem>
                   <PopoverMenuItem key="bookmarks">
                     <FormattedMessage id="bookmarks" defaultMessage="Bookmarks" />
                   </PopoverMenuItem>


Test patch:
diff --git a/src/stories/__snapshots__/stories.test.js.snap b/src/stories/__snapshots__/stories.test.js.snap
index 9c6a62cb..26b2dc45 100644
--- a/src/stories/__snapshots__/stories.test.js.snap
+++ b/src/stories/__snapshots__/stories.test.js.snap
@@ -655,6 +655,22 @@ exports[`Storyshots Navigation Sidenav 1`] = `
           </span>
         </a>
       </li>
+      <li>
+        <a
+          aria-current={false}
+          className={undefined}
+          href="/replies"
+          onClick={[Function]}
+          style={undefined}
+        >
+          <i
+            className="iconfont icon-message"
+          />
+          <span>
+            Replies
+          </span>
+        </a>
+      </li>
       <li>
         <a
           aria-current={false}