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
14 changes: 13 additions & 1 deletion src/app/recruit/core/completed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import Link from 'next/link'
import { useSearchParams } from 'next/navigation'
import { GdgLogo, GdgButton } from '@/components/ui/design-system'

function Bullet({ children }: { children: React.ReactNode }) {
Expand All @@ -15,17 +16,28 @@ function Bullet({ children }: { children: React.ReactNode }) {
}

export default function RecruitCoreCompleted() {
const searchParams = useSearchParams()
const isClosed = searchParams.get('status') === 'closed'

return (
<main className="min-h-screen bg-black overflow-x-hidden">
<div className="relative z-10 pt-18 pb-32 mobile:pt-12 mobile:pb-24 layout-grid layout-grid--narrow-screen layout-grid--4 gap-y-10">
{/* Header */}
<div className="col-span-4 flex items-center gap-3 mobile:gap-2">
<GdgLogo mode="auto" />
<h1 className="typo-pc-h3 text-white mobile:typo-m-h2">Core Member 지원 완료</h1>
<h1 className="typo-pc-h3 text-white mobile:typo-m-h2">
{isClosed ? 'Core Member 지원 마감' : 'Core Member 지원 완료'}
</h1>
</div>

{/* Content Sections - Step 2 UI 이관 */}
<div className="col-span-4 flex flex-col gap-10 w-full">
<div className="rounded-xl bg-gray-100 px-4 py-3 text-white typo-pc-b2 mobile:typo-m-b3">
{isClosed
? '코어 지원 기간이 종료되어 더 이상 지원서를 제출할 수 없습니다.'
: '지원이 정상적으로 완료되었습니다. 이후 일정은 아래 안내를 확인해 주세요.'}
</div>

<div className="space-y-2">
<p className="pl-2 typo-pc-s2 mobile:typo-m-s1 text-white">모집 일정</p>
<div className="rounded-xl bg-gray-100 px-4 py-3 text-white">
Expand Down
23 changes: 22 additions & 1 deletion src/app/recruit/core/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const TEAM_OPTIONS = [
{ id: 'TECH', label: 'TECH' },
{ id: 'PR_DESIGN', label: 'PR·DESIGN' }
] as const
const CORE_RECRUIT_DEADLINE = '2026-03-14T23:59:59+09:00'

const unwrapPrefill = (raw: unknown): PrefillPayload | null => {
if (!raw || typeof raw !== 'object') return null
Expand Down Expand Up @@ -202,6 +203,7 @@ export default function RecruitCore() {
const [isSubmitting, setIsSubmitting] = useState(false)
const [scheduleChecked, setScheduleChecked] = useState(false)
const [agreementChecked, setAgreementChecked] = useState(false)
const isRecruitClosed = Date.now() > new Date(CORE_RECRUIT_DEADLINE).getTime()

const [formData, setFormData] = useState<RecruitFormData>({
name: '',
Expand Down Expand Up @@ -242,6 +244,19 @@ export default function RecruitCore() {
}, [currentStep, formData, scheduleChecked, agreementChecked])

useEffect(() => {
if (!isRecruitClosed) {
return
}

alert('코어 지원 기간이 종료되었습니다.')
router.replace('/recruit/core/completed?status=closed')
}, [isRecruitClosed, router])

useEffect(() => {
if (isRecruitClosed) {
return
}

let active = true

const fetchPrefill = async () => {
Expand Down Expand Up @@ -278,7 +293,7 @@ export default function RecruitCore() {
return () => {
active = false
}
}, [apiClient, router])
}, [apiClient, isRecruitClosed, router])

const validateStep = (step: RecruitStep) => {
const nextErrors: Record<string, boolean> = {}
Expand Down Expand Up @@ -399,6 +414,12 @@ export default function RecruitCore() {
const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault()

if (isRecruitClosed) {
alert('코어 지원 기간이 종료되었습니다.')
router.replace('/recruit/core/completed?status=closed')
return
}

if (!validateStep(currentStep)) return

if (currentStep < 3) {
Expand Down
Loading