Skip to content

Commit f2d9e88

Browse files
committed
feat: 사이드 네비게이션의 홈 메뉴 아이템 경로 수정 및 활성 상태 로직 개선
1 parent a3826bd commit f2d9e88

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/SideNav.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type MenuItem = {
1111
const menuItems: MenuItem[] = [
1212
{
1313
name: 'Home',
14-
pathname: '',
14+
pathname: '/',
1515
icon: House,
1616
},
1717
{

src/components/SideNavItem.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
99
const {pathname, label, icon} = Astro.props;
1010
11-
const active = pathname === Astro.url.pathname.replace(/\/+$/, '');
11+
const active = pathname === (Astro.url.pathname.replace(/\/+$/, '') || "/");
1212
---
1313

1414
<a href={pathname} class=`p-3 flex flex-row items-center gap-3 cursor-pointer rounded-full text-bright select-none transition-all

0 commit comments

Comments
 (0)