Skip to content

Commit 2965193

Browse files
authored
Merge pull request #70 from Team-StackUp/feature/interview-buttons
Feature/interview buttons
2 parents 3cf80a9 + bc33942 commit 2965193

4 files changed

Lines changed: 47 additions & 15 deletions

File tree

frontend/src/features/interview/ui/live/LiveInterview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function LiveInterview({ sessionId }: { sessionId: number }) {
2222
return <InterviewLobby sessionId={sessionId} session={session} />
2323
}
2424
if (status !== 'IN_PROGRESS') {
25-
return <SessionEndedPanel status={status ?? 'COMPLETED'} />
25+
return <SessionEndedPanel status={status ?? 'COMPLETED'} sessionId={sessionId} />
2626
}
2727

2828
const awaitingQuestion = turn === 'WAITING_FOR_QUESTION'

frontend/src/features/interview/ui/live/SessionEndedPanel.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@ const messageByStatus: Partial<Record<SessionStatus, string>> = {
88
CANCELLED: '면접이 취소되었습니다.',
99
}
1010

11-
export function SessionEndedPanel({ status }: { status: SessionStatus }) {
11+
export function SessionEndedPanel({
12+
status,
13+
sessionId,
14+
}: {
15+
status: SessionStatus
16+
sessionId: number
17+
}) {
1218
return (
1319
<div className="flex flex-col items-center gap-4 px-4 py-16 text-center">
1420
<p className="text-rich text-fg">{messageByStatus[status] ?? '면접이 종료되었습니다.'}</p>
15-
<Link to="/workspace">
16-
<Button variant="secondary">워크스페이스로</Button>
17-
</Link>
21+
<div className="flex flex-wrap items-center justify-center gap-3">
22+
{status === 'COMPLETED' && (
23+
<Link to={`/sessions/${sessionId}/feedback`}>
24+
<Button>피드백 보기</Button>
25+
</Link>
26+
)}
27+
<Link to="/workspace">
28+
<Button variant="secondary">워크스페이스로</Button>
29+
</Link>
30+
</div>
1831
</div>
1932
)
2033
}

frontend/src/pages/Home/ui/HomePage.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { useEffect } from 'react'
2+
import { useLocation } from 'react-router-dom'
13
import { SiteNav } from '@/widgets/site-nav'
24
import { HomeHero } from '@/widgets/home-hero'
35
import { HomeServices } from '@/widgets/home-services'
@@ -7,6 +9,23 @@ import { HomeCta } from '@/widgets/home-cta'
79
import { SiteFooter } from '@/widgets/site-footer'
810

911
export default function HomePage() {
12+
const { hash } = useLocation()
13+
14+
// 다른 페이지 또는 풀 리로드로 진입할 때 #section 으로 스크롤.
15+
// (라우터는 hash 스크롤을 보장하지 않고, 풀 리로드 시 엘리먼트가
16+
// 아직 마운트 전이라 브라우저 기본 스크롤이 빗나감)
17+
useEffect(() => {
18+
const id = hash.replace('#', '')
19+
if (!id) {
20+
window.scrollTo({ top: 0 })
21+
return
22+
}
23+
const raf = requestAnimationFrame(() => {
24+
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' })
25+
})
26+
return () => cancelAnimationFrame(raf)
27+
}, [hash])
28+
1029
return (
1130
<div className="min-h-svh bg-bg text-fg">
1231
<SiteNav />

frontend/src/widgets/site-nav/ui/SiteNav.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Link } from 'react-router-dom'
33
import { useAuth, useLogout } from '@/features/auth'
44

55
const items = [
6-
{ href: '#services', label: 'Services' },
7-
{ href: '#quote', label: 'About' },
8-
{ href: '#faq', label: 'FAQ' },
6+
{ to: '/#services', label: 'Services' },
7+
{ to: '/#quote', label: 'About' },
8+
{ to: '/#faq', label: 'FAQ' },
99
]
1010

1111
export function SiteNav() {
@@ -31,22 +31,22 @@ export function SiteNav() {
3131
style={{ zIndex: 'var(--z-sticky)' }}
3232
>
3333
<div className="mx-auto max-w-content px-6 lg:px-12 h-16 flex items-center justify-between">
34-
<a
35-
href="#top"
34+
<Link
35+
to="/#top"
3636
className="font-heading font-extrabold tracking-[0.04em] text-sage-900 text-[15px] uppercase"
3737
>
3838
Stack Up
39-
</a>
39+
</Link>
4040

4141
<nav aria-label="Primary" className="hidden md:flex items-center gap-1">
4242
{items.map((it) => (
43-
<a
44-
key={it.href}
45-
href={it.href}
43+
<Link
44+
key={it.to}
45+
to={it.to}
4646
className="px-3 py-2 text-button text-fg-strong/80 hover:text-fg-strong transition-colors duration-fast"
4747
>
4848
{it.label}
49-
</a>
49+
</Link>
5050
))}
5151
</nav>
5252

0 commit comments

Comments
 (0)