A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: side nav only pathanme is /tags active
shuaiad3adb7e8667
diff --git a/ui/src/components/Header/index.scss b/ui/src/components/Header/index.scssindex 0010ff2d..01347844 100644--- a/ui/src/components/Header/index.scss+++ b/ui/src/components/Header/index.scss@@ -1,6 +1,7 @@@import 'bootstrap/scss/functions';@import 'bootstrap/scss/variables';#header {+ transform: translate3d(0,0,0);--bs-navbar-padding-y: 0.75rem;background: linear-gradient(180deg, rgb(var(--bs-primary-rgb)) 0%, rgba(var(--bs-primary-rgb), 0.95) 100%);box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 0.125rem 0.25rem rgb(0 0 0 / 8%);diff --git a/ui/src/components/SideNav/index.tsx b/ui/src/components/SideNav/index.tsxindex 3efe7653..067232de 100644--- a/ui/src/components/SideNav/index.tsx+++ b/ui/src/components/SideNav/index.tsx@@ -1,6 +1,6 @@import { FC } from 'react';import { Col, Nav } from 'react-bootstrap';-import { NavLink, useLocation } from 'react-router-dom';+import { NavLink, useLocation, useNavigate } from 'react-router-dom';import { useTranslation } from 'react-i18next';import classnames from 'classnames';@@ -11,9 +11,15 @@ import './index.scss';const Index: FC = () => {const { t } = useTranslation();+ const navigate = useNavigate();const { pathname } = useLocation();const { user: userInfo } = loggedUserInfoStore();const { visible, can_revision, revision } = sideNavStore();++ const handleNavClick = (e, path) => {+ e.preventDefault();+ navigate(path);+ };return (<Colxl={2}@@ -35,10 +41,13 @@ const Index: FC = () => {<span>{t('header.nav.question')}</span></NavLink>- <NavLink to="/tags" className="nav-link">+ <Nav.Link+ href="/tags"+ active={pathname === '/tags'}+ onClick={(e) => handleNavClick(e, '/tags')}><Icon name="tags-fill" className="me-2" /><span>{t('header.nav.tag')}</span>- </NavLink>+ </Nav.Link><NavLink to="/users" className="nav-link"><Icon name="people-fill" className="me-2" />