Skip to content

Commit bc045e4

Browse files
Merge pull request #92 from SSASINSA/refactor/sprint-fix(#68)
#68/네비게이션 수정
2 parents 7dac517 + f7a33d7 commit bc045e4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/components/layout/Navigation/Navigation.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,19 @@ const Navigation: React.FC = () => {
150150
<nav className={styles["sidebar-nav"]}>
151151
<ul>
152152
{!isRoleLoading && filteredNavItems.map((item) => {
153-
const isActive = location.pathname === item.path ||
154-
(item.path !== "/" && location.pathname.startsWith(item.path + "/"));
153+
let isActive: boolean;
154+
155+
if (item.path === "/events") {
156+
isActive = location.pathname === "/events" ||
157+
(location.pathname.startsWith("/events/") && !location.pathname.startsWith("/events/approval"));
158+
} else if (item.path === "/users") {
159+
isActive = location.pathname === "/users" ||
160+
location.pathname.startsWith("/users/") ||
161+
location.pathname.startsWith("/repair/");
162+
} else {
163+
isActive = location.pathname === item.path ||
164+
(item.path !== "/" && location.pathname.startsWith(item.path + "/"));
165+
}
155166

156167
return (
157168
<li key={item.path} className={isActive ? styles["active"] : ""}>

0 commit comments

Comments
 (0)