From 56ff684f1426a545f07fe0e4a613d5300efc5b8d Mon Sep 17 00:00:00 2001 From: Sujal Lama Date: Wed, 21 Jul 2021 17:19:30 +0545 Subject: [PATCH 1/2] sidebar active fix --- src/components/sidebar/Sidebar.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/sidebar/Sidebar.jsx b/src/components/sidebar/Sidebar.jsx index afad5a5a9..ced46c3df 100644 --- a/src/components/sidebar/Sidebar.jsx +++ b/src/components/sidebar/Sidebar.jsx @@ -24,16 +24,19 @@ const Sidebar = ({ setToggle, toggle, mobileView, burgerActive }) => { { name: 'Members', slug: `/community-members/${currentCommunity && currentCommunity.slug}`, + root: 'community-members', initial: 'Me' }, { name: 'Groups', slug: `/community-group/${currentCommunity && currentCommunity.slug}`, + root: 'community-group', initial: 'Gr' }, { name: 'Enterprises', slug: `/enterprises/${currentCommunity && currentCommunity.slug}`, + root: 'enterprises', initial: 'En' } ] @@ -86,7 +89,7 @@ const Sidebar = ({ setToggle, toggle, mobileView, burgerActive }) => { src='/img/calendar-icon.svg' alt='calendar-icon' onClick={() => history.push('/calendar/my-events')} - /> + /> @@ -120,7 +123,7 @@ function MainNav ({ dropdownActive, setDropdownActive, navMenu, toggle }) { : navitem.name === 'Library' ? () => history.push(`${navitem.slug}`) : () => history.push(`${navitem.slug}`)} - className={`${pathname === `${navitem.slug}` ? ' text-menu text-active' : 'text-menu'}`} + className={`${"/".concat(pathname.split('/')[1]) === `${navitem.slug}` ? ' text-menu text-active' : 'text-menu'}`} >
history.push(`${navitem.slug}`)} className='align-content'> { @@ -135,7 +138,7 @@ function MainNav ({ dropdownActive, setDropdownActive, navMenu, toggle }) { { navitem.dropdown.map(item => { return ( -
+
  • history.push(`${item.slug}`)} className='dropdown-item'> {toggle ? item.name : item.initial}
  • From 61c07a771fca9787409a1760e38bcc70649162d1 Mon Sep 17 00:00:00 2001 From: Sujal Lama Date: Wed, 21 Jul 2021 17:20:23 +0545 Subject: [PATCH 2/2] sidebar js lint fix --- src/components/sidebar/Sidebar.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/sidebar/Sidebar.jsx b/src/components/sidebar/Sidebar.jsx index ced46c3df..7c3fa804f 100644 --- a/src/components/sidebar/Sidebar.jsx +++ b/src/components/sidebar/Sidebar.jsx @@ -89,7 +89,7 @@ const Sidebar = ({ setToggle, toggle, mobileView, burgerActive }) => { src='/img/calendar-icon.svg' alt='calendar-icon' onClick={() => history.push('/calendar/my-events')} - /> + />
    @@ -123,7 +123,7 @@ function MainNav ({ dropdownActive, setDropdownActive, navMenu, toggle }) { : navitem.name === 'Library' ? () => history.push(`${navitem.slug}`) : () => history.push(`${navitem.slug}`)} - className={`${"/".concat(pathname.split('/')[1]) === `${navitem.slug}` ? ' text-menu text-active' : 'text-menu'}`} + className={`${'/'.concat(pathname.split('/')[1]) === `${navitem.slug}` ? ' text-menu text-active' : 'text-menu'}`} >
    history.push(`${navitem.slug}`)} className='align-content'> {