diff --git a/frontend/src/features/interview/ui/live/LiveInterview.tsx b/frontend/src/features/interview/ui/live/LiveInterview.tsx index 358438fe..78b5aa44 100644 --- a/frontend/src/features/interview/ui/live/LiveInterview.tsx +++ b/frontend/src/features/interview/ui/live/LiveInterview.tsx @@ -22,7 +22,7 @@ export function LiveInterview({ sessionId }: { sessionId: number }) { return } if (status !== 'IN_PROGRESS') { - return + return } const awaitingQuestion = turn === 'WAITING_FOR_QUESTION' diff --git a/frontend/src/features/interview/ui/live/SessionEndedPanel.tsx b/frontend/src/features/interview/ui/live/SessionEndedPanel.tsx index 7823b5d7..8824ff3f 100644 --- a/frontend/src/features/interview/ui/live/SessionEndedPanel.tsx +++ b/frontend/src/features/interview/ui/live/SessionEndedPanel.tsx @@ -8,13 +8,26 @@ const messageByStatus: Partial> = { CANCELLED: '면접이 취소되었습니다.', } -export function SessionEndedPanel({ status }: { status: SessionStatus }) { +export function SessionEndedPanel({ + status, + sessionId, +}: { + status: SessionStatus + sessionId: number +}) { return ( {messageByStatus[status] ?? '면접이 종료되었습니다.'} - - 워크스페이스로 - + + {status === 'COMPLETED' && ( + + 피드백 보기 + + )} + + 워크스페이스로 + + ) } diff --git a/frontend/src/pages/Home/ui/HomePage.tsx b/frontend/src/pages/Home/ui/HomePage.tsx index d58bccd4..9f059179 100644 --- a/frontend/src/pages/Home/ui/HomePage.tsx +++ b/frontend/src/pages/Home/ui/HomePage.tsx @@ -1,3 +1,5 @@ +import { useEffect } from 'react' +import { useLocation } from 'react-router-dom' import { SiteNav } from '@/widgets/site-nav' import { HomeHero } from '@/widgets/home-hero' import { HomeServices } from '@/widgets/home-services' @@ -7,6 +9,23 @@ import { HomeCta } from '@/widgets/home-cta' import { SiteFooter } from '@/widgets/site-footer' export default function HomePage() { + const { hash } = useLocation() + + // 다른 페이지 또는 풀 리로드로 진입할 때 #section 으로 스크롤. + // (라우터는 hash 스크롤을 보장하지 않고, 풀 리로드 시 엘리먼트가 + // 아직 마운트 전이라 브라우저 기본 스크롤이 빗나감) + useEffect(() => { + const id = hash.replace('#', '') + if (!id) { + window.scrollTo({ top: 0 }) + return + } + const raf = requestAnimationFrame(() => { + document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' }) + }) + return () => cancelAnimationFrame(raf) + }, [hash]) + return ( diff --git a/frontend/src/widgets/site-nav/ui/SiteNav.tsx b/frontend/src/widgets/site-nav/ui/SiteNav.tsx index 37d8c096..de6b7d68 100644 --- a/frontend/src/widgets/site-nav/ui/SiteNav.tsx +++ b/frontend/src/widgets/site-nav/ui/SiteNav.tsx @@ -3,9 +3,9 @@ import { Link } from 'react-router-dom' import { useAuth, useLogout } from '@/features/auth' const items = [ - { href: '#services', label: 'Services' }, - { href: '#quote', label: 'About' }, - { href: '#faq', label: 'FAQ' }, + { to: '/#services', label: 'Services' }, + { to: '/#quote', label: 'About' }, + { to: '/#faq', label: 'FAQ' }, ] export function SiteNav() { @@ -31,22 +31,22 @@ export function SiteNav() { style={{ zIndex: 'var(--z-sticky)' }} > - Stack Up - + {items.map((it) => ( - {it.label} - + ))}
{messageByStatus[status] ?? '면접이 종료되었습니다.'}