fix: chat nav highlight

This commit is contained in:
zerosoul
2022-06-14 18:12:27 +08:00
parent 2c8de29ca7
commit bff68d6c8e
+4 -3
View File
@@ -40,7 +40,8 @@ export default function HomePage() {
if (loading || !ready) {
return <Loading reload={true} fullscreen={true} />;
}
const isSettingPage = pathname.startsWith("/setting");
const isSettingPage = isHomePath || pathname.startsWith("/setting");
const isChattingPage = pathname.startsWith("/chat");
if (isSettingPage) {
return (
<>
@@ -62,8 +63,8 @@ export default function HomePage() {
<User uid={loginUid} />
<nav className="link_navs">
<NavLink
className={({ isActive }) => {
return `link ${isHomePath || isActive ? "active" : ""}`;
className={() => {
return `link ${isChattingPage ? "active" : ""}`;
}}
to={chatNav}
>