diff --git a/frontend/src/b/BLayout.tsx b/frontend/src/b/BLayout.tsx index fca9a25..bbb3afa 100644 --- a/frontend/src/b/BLayout.tsx +++ b/frontend/src/b/BLayout.tsx @@ -48,17 +48,17 @@ function TopBar() { const tab = TABS.find((t) => t.to !== '/' && pathname.startsWith(t.to)) return ( -
+
{tab?.title ?

{tab.title}

:

날씨각

} {mePending ? ( @@ -208,6 +208,10 @@ function Shell() { useEffect(() => { window.scrollTo({ top: 0 }) }, [pathname]) + // 지금 보고 있는 탭을 다시 누르면 맨 위로 + const toTopIfHere = (to: string) => () => { + if (pathname === to) window.scrollTo({ top: 0, behavior: 'smooth' }) + } useEffect(() => { document.querySelector('meta[name="theme-color"]')?.setAttribute('content', NOTCH_BG[kind]) }, [kind]) @@ -228,14 +232,14 @@ function Shell() { {TABS.map((t) => t.key === 'today' ? ( // 메인 탭: 막대 위로 솟은 큰 주황 동그라미 - cx('b-tab-main relative -mt-6 flex flex-col items-center gap-1 text-[12px] font-extrabold', isActive ? 'text-(--orange)' : 'text-(--ink3)')}> + cx('b-tab-main relative -mt-6 flex flex-col items-center gap-1 text-[12px] font-extrabold', isActive ? 'text-(--orange)' : 'text-(--ink3)')}> {t.label} ) : ( - cx('flex flex-col items-center gap-0.5 text-[11px] font-extrabold', isActive ? 'text-(--ink) [&_svg]:stroke-[2.4]' : 'text-(--ink3) [&_svg]:stroke-[1.9]')}> + cx('flex flex-col items-center gap-0.5 text-[11px] font-extrabold', isActive ? 'text-(--ink) [&_svg]:stroke-[2.4]' : 'text-(--ink3) [&_svg]:stroke-[1.9]')}> {t.label}