Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/features/interview/ui/live/LiveInterview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function LiveInterview({ sessionId }: { sessionId: number }) {
return <InterviewLobby sessionId={sessionId} session={session} />
}
if (status !== 'IN_PROGRESS') {
return <SessionEndedPanel status={status ?? 'COMPLETED'} />
return <SessionEndedPanel status={status ?? 'COMPLETED'} sessionId={sessionId} />
}

const awaitingQuestion = turn === 'WAITING_FOR_QUESTION'
Expand Down
21 changes: 17 additions & 4 deletions frontend/src/features/interview/ui/live/SessionEndedPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,26 @@ const messageByStatus: Partial<Record<SessionStatus, string>> = {
CANCELLED: '면접이 취소되었습니다.',
}

export function SessionEndedPanel({ status }: { status: SessionStatus }) {
export function SessionEndedPanel({
status,
sessionId,
}: {
status: SessionStatus
sessionId: number
}) {
return (
<div className="flex flex-col items-center gap-4 px-4 py-16 text-center">
<p className="text-rich text-fg">{messageByStatus[status] ?? '면접이 종료되었습니다.'}</p>
<Link to="/workspace">
<Button variant="secondary">워크스페이스로</Button>
</Link>
<div className="flex flex-wrap items-center justify-center gap-3">
{status === 'COMPLETED' && (
<Link to={`/sessions/${sessionId}/feedback`}>
<Button>피드백 보기</Button>
</Link>
)}
<Link to="/workspace">
<Button variant="secondary">워크스페이스로</Button>
</Link>
</div>
</div>
)
}
19 changes: 19 additions & 0 deletions frontend/src/pages/Home/ui/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 (
<div className="min-h-svh bg-bg text-fg">
<SiteNav />
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/widgets/site-nav/ui/SiteNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -31,22 +31,22 @@ export function SiteNav() {
style={{ zIndex: 'var(--z-sticky)' }}
>
<div className="mx-auto max-w-content px-6 lg:px-12 h-16 flex items-center justify-between">
<a
href="#top"
<Link
to="/#top"
className="font-heading font-extrabold tracking-[0.04em] text-sage-900 text-[15px] uppercase"
>
Stack Up
</a>
</Link>

<nav aria-label="Primary" className="hidden md:flex items-center gap-1">
{items.map((it) => (
<a
key={it.href}
href={it.href}
<Link
key={it.to}
to={it.to}
className="px-3 py-2 text-button text-fg-strong/80 hover:text-fg-strong transition-colors duration-fast"
>
{it.label}
</a>
</Link>
))}
</nav>

Expand Down