Skip to content

Commit 81fcbf9

Browse files
authored
Merge pull request #64 from LIKELION-SOGANG/feature/apply-page-interaction#59
Feature/apply page interaction#59
2 parents 7e2b24c + 266cfaf commit 81fcbf9

19 files changed

+163
-175
lines changed

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
"rules": {
1111
"react/no-unescaped-entities": 0,
1212
"@typescript-eslint/no-unused-vars": "off",
13-
"unused-imports/no-unused-imports": "error"
13+
"unused-imports/no-unused-imports": "error",
14+
"prettier/prettier": [
15+
"error",
16+
{
17+
"endOfLine": "auto"
18+
}
19+
]
1420
}
1521
}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"endOfLine": "lf",
77
"trailingComma": "none",
88
"arrowParens": "avoid"
9-
}
9+
}

src/app/(apply)/apply/components/CheckingPass.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ import Passed from './Passed'
55
import Nonpassed from './Nonpassed'
66

77
const CheckingPass = () => {
8+
const onChangeInput = () => {
9+
console.log('not yet')
10+
}
811
return (
912
<div className="flex flex-col items-center bg-white">
1013
<div className="w-[56.2rem]">
1114
<SmallInput
15+
onChangeInput={onChangeInput}
16+
value=""
17+
name="gitURL"
1218
title=""
1319
placeholder="이메일로 발송된 고유 번호를 입력해주세요."
1420
/>
@@ -18,11 +24,8 @@ const CheckingPass = () => {
1824
isable={false}
1925
/>
2026
</div>
21-
2227
<Passed />
2328
<Nonpassed />
2429
</div>
2530
)
2631
}
27-
28-
export default CheckingPass

src/app/(apply)/apply/components/Progress.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import React, { useEffect, useRef, useState } from 'react'
22

33
const Progress = ({ step }: { step: number }) => {
4-
const mountRef = useRef(false)
5-
const [progress, setProgress] = useState([false, false, false])
6-
74
const allSteps = ['인적사항 입력', '지원서 작성', '지원서 저장']
5+
const mountRef = useRef(false)
6+
const [progress, setProgress] = useState(Array(allSteps.length).fill(false))
87

98
useEffect(() => {
109
if (!mountRef.current) {
1110
mountRef.current = true
1211
return
1312
}
14-
1513
setProgress(prev => {
1614
const newProgress = [...prev]
1715
newProgress[step - 1] = true
@@ -35,7 +33,7 @@ const Progress = ({ step }: { step: number }) => {
3533
) : (
3634
<div className="flex justify-center items-center ">
3735
<div
38-
className={`m-[0_1.4rem] w-[12.2rem] h-[1px] ${progress[index + 1] ? 'bg-black' : 'bg-[#d9d9d9]'}`}></div>
36+
className={`m-[0_1.4rem] w-[12.2rem] h-[1px] ${progress[index + 1] ? 'bg-black ' : 'bg-[#d9d9d9]'}`}></div>
3937
</div>
4038
)}
4139
</div>

src/app/(apply)/apply/components/SelectTimeDay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SelectTimeDay = () => {
55
return (
66
<div className="flex flex-col gap-[2rem]">
77
<div className="text-[1.6rem] font-medium">
8-
6. 면접 가능한 날짜와 시간을 모두 선택해주세요.
8+
5. 면접 가능한 날짜와 시간을 모두 선택해주세요.
99
</div>
1010
{meeting.map((item, index1) => {
1111
return (

src/app/(apply)/apply/components/SmallInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react'
22

33
interface SmallInputProps {
4-
onChangeInput?: (e: React.ChangeEvent<HTMLInputElement>) => void
5-
placeholder?: string
6-
name?: string
7-
value?: string
8-
title?: string
4+
onChangeInput: (e: React.ChangeEvent<HTMLInputElement>) => void
5+
placeholder: string
6+
name: string
7+
value: string
8+
title: string
99
}
1010

1111
const SmallInput = ({

src/app/(apply)/apply/container/ApplySection.tsx

Lines changed: 70 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,80 @@
1+
'use client'
2+
3+
import React, { useState } from 'react'
14
import Button from '../components/Button'
25
import SmallInput from '../components/SmallInput'
3-
// import ApplyHeader from '../components/ApplyHeader'
4-
// import SaveComplete from './SaveComplete'
5-
// import EditPersonalInfo from './EditPersonalInfo'
6-
// import CheckingPass from '../components/CheckingPass'
7-
// import PersonalInformationForm from './PersonalInformationForm'
8-
// import PersonalStatementForm from './PersonalStatementForm'
9-
// import Passed from '../components/Passed'
10-
// import Nonpassed from '../components/Nonpassed'
11-
12-
//
13-
//
14-
//
6+
import PersonalInformationForm from './PersonalInformationForm'
7+
import PersonalStatementForm from './PersonalStatementForm'
8+
import Progress from '../components/Progress'
9+
import SaveComplete from './SaveComplete'
1510

1611
const ApplySection = () => {
12+
const [step, setStep] = useState(0)
13+
14+
const onClickStep = () => {
15+
setStep(prev => prev + 1)
16+
window.scrollTo(0, 0)
17+
}
18+
19+
const onChangeInput = () => {
20+
console.log('not yet')
21+
}
22+
1723
return (
18-
<>
19-
<div className="mb-[19rem]"></div>
20-
<div>
21-
<div className="text-[1.6rem] font-medium mb-[1.2rem]">
22-
처음 지원서를 작성하신다면,
23-
</div>
24-
<div>
25-
<Button
26-
title="지원서 생성하기"
27-
isable={true}
28-
/>
29-
</div>
30-
</div>
24+
<section className="overflow-x-hidden pt-[2rem] bg-white text-black">
25+
<div className="flex flex-col items-center h-full">
26+
<div className="w-[56.2rem]">
27+
{step !== 0 ? <Progress step={step} /> : null}
3128

32-
<div className="mb-[7rem]"></div>
33-
34-
<div>
35-
<SmallInput
36-
title="이미 작성하던 지원서가 있으시다면,"
37-
placeholder="이메일로 발송된 고유번호를 입력해주세요."
38-
/>
39-
<div className="mb-[1.2rem]"></div>
40-
<Button
41-
title="지원서 수정하기"
42-
isable={false}
43-
/>
44-
</div>
29+
{step === 0 ? (
30+
<div>
31+
<div className="mb-[15rem]"></div>
4532

46-
<div className="mb-[1.2rem]"></div>
47-
</>
33+
<div>
34+
<div className="text-[1.6rem] font-medium mb-[1.2rem]">
35+
처음 지원서를 작성하신다면,
36+
</div>
37+
<div
38+
onClick={onClickStep}
39+
className="cursor-pointer">
40+
<Button
41+
title="지원서 생성하기"
42+
isable={true}
43+
/>
44+
</div>
45+
</div>
46+
47+
<div className="mb-[7rem]"></div>
48+
49+
<div>
50+
<SmallInput
51+
onChangeInput={onChangeInput}
52+
value=""
53+
name="uniqueNumber"
54+
title="이미 작성하던 지원서가 있으시다면,"
55+
placeholder="이메일로 발송된 고유번호를 입력해주세요."
56+
/>
57+
<div className="mb-[1.2rem]"></div>
58+
<Button
59+
title="지원서 수정하기"
60+
isable={false}
61+
/>
62+
</div>
63+
</div>
64+
) : null}
65+
66+
{step === 1 ? (
67+
<PersonalInformationForm onClickStep={onClickStep} />
68+
) : null}
69+
70+
{step === 2 ? (
71+
<PersonalStatementForm onClickStep={onClickStep} />
72+
) : null}
73+
74+
{step === 3 ? <SaveComplete /> : null}
75+
</div>
76+
</div>
77+
</section>
4878
)
4979
}
5080

src/app/(apply)/apply/container/EditPersonalInfo.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ import SelectPart from '../components/SelectPart'
44
import Button from '../components/Button'
55

66
const EditPersonalInfo = () => {
7+
const onChangeInput = () => {
8+
console.log('not yet')
9+
}
10+
711
return (
812
<div className="w-[56.2rem] relative">
913
<div className="flex flex-col gap-[5rem] mb-[5rem]">
1014
{personalInformation.map((item, index) => (
1115
<SmallInput
16+
onChangeInput={onChangeInput}
17+
value=""
18+
name="gitURL"
1219
key={index}
1320
title={item.title}
1421
placeholder={item.placeholder}

src/app/(main)/recruit/components/PCOnly.tsx renamed to src/app/(apply)/apply/container/PCOnly.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
'use client'
2+
13
import React from 'react'
24
import CloseXWhite from '../../../../../public/icon/button/closeX-white.svg'
35
import { PCONLY_MODAL } from '@/style/zIndex'
6+
import { useRouter } from 'next/navigation'
47

5-
interface PcOnlyProps {
6-
setPcOnly: React.Dispatch<React.SetStateAction<boolean>>
7-
}
8+
const PCOnly = () => {
9+
const router = useRouter()
10+
11+
const onClickCloseXWhite = () => {
12+
router.push('/recruit')
13+
}
814

9-
const PCOnly = ({ setPcOnly }: PcOnlyProps) => {
1015
return (
1116
<main
1217
className="w-screen h-screen bg-black fixed py-[5rem] px-[3rem] flex flex-col justify-between text-white"
@@ -16,12 +21,7 @@ const PCOnly = ({ setPcOnly }: PcOnlyProps) => {
1621
Like<span className="italic ">lion</span> So
1722
<span className="italic">gang</span>
1823
</div>
19-
<button
20-
onClick={() =>
21-
setPcOnly(prev => {
22-
return !prev
23-
})
24-
}>
24+
<button onClick={onClickCloseXWhite}>
2525
<CloseXWhite />
2626
</button>
2727
</div>

src/app/(apply)/apply/container/PersonalInformationForm.tsx

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,24 @@
1-
'use client'
2-
3-
import React, { useState } from 'react'
1+
import React from 'react'
42
import SmallInput from '../components/SmallInput'
53
import Button from '../components/Button'
64
import {
75
personalInformation,
86
personalPhoneNumber
97
} from '@/utils/recruitMockData'
108

9+
//
10+
//
11+
//
12+
1113
interface PersonalStatementFormProps {
1214
onClickStep: () => void
1315
}
1416

15-
// 해야할 것
16-
// 1. 미입력시 예외 처리
17-
// 2. 이메일로 고유번호 발송
18-
// 3. 정상 입력 후 버튼 클릭시 데이터 페칭, 다음으로 넘어가기
19-
2017
const PersonalInformationForm = ({
2118
onClickStep
2219
}: PersonalStatementFormProps) => {
23-
const [personalInfo, setPersonalInfo] = useState({
24-
name: '',
25-
studentNumbder: '',
26-
email: '',
27-
phone: ''
28-
})
29-
30-
const onChangeInput = (e: React.ChangeEvent<HTMLInputElement>) => {
31-
console.log(personalInfo)
32-
const { name, value } = e.target
33-
34-
setPersonalInfo(prev => {
35-
return { ...prev, [name]: value }
36-
})
20+
const onChangeInput = () => {
21+
console.log('not yet')
3722
}
3823

3924
return (
@@ -42,18 +27,18 @@ const PersonalInformationForm = ({
4227
{personalInformation.map((item, index) => (
4328
<SmallInput
4429
onChangeInput={onChangeInput}
45-
name={item.name}
30+
value=""
31+
name=""
4632
key={index}
4733
title={item.title}
48-
value={personalInfo[item.name as keyof typeof personalInfo]}
4934
placeholder={item.placeholder}
5035
/>
5136
))}
5237

5338
<SmallInput
5439
onChangeInput={onChangeInput}
55-
name="phone"
56-
value={personalInfo.phone}
40+
value=""
41+
name=""
5742
title={personalPhoneNumber.title}
5843
placeholder={personalPhoneNumber.placeholder}
5944
/>

0 commit comments

Comments
 (0)