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) { if (loading || !ready) {
return <Loading reload={true} fullscreen={true} />; return <Loading reload={true} fullscreen={true} />;
} }
const isSettingPage = pathname.startsWith("/setting"); const isSettingPage = isHomePath || pathname.startsWith("/setting");
const isChattingPage = pathname.startsWith("/chat");
if (isSettingPage) { if (isSettingPage) {
return ( return (
<> <>
@@ -62,8 +63,8 @@ export default function HomePage() {
<User uid={loginUid} /> <User uid={loginUid} />
<nav className="link_navs"> <nav className="link_navs">
<NavLink <NavLink
className={({ isActive }) => { className={() => {
return `link ${isHomePath || isActive ? "active" : ""}`; return `link ${isChattingPage ? "active" : ""}`;
}} }}
to={chatNav} to={chatNav}
> >