Skip to content

Commit c42b7de

Browse files
♻️ 회원가입 화면 코드리뷰 반영
1 parent 216a531 commit c42b7de

File tree

2 files changed

+60
-58
lines changed

2 files changed

+60
-58
lines changed

components/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ function InputField({
6767

6868
//스타일에 따른 클래스
6969
const variantClass = {
70-
containerVertical: 'mb-[24px] flex flex-col gap-[10px]',
71-
containerHorizontal: 'mb-[24px] w-[239px] flex items-center gap-[10px]',
70+
containerVertical: 'flex flex-col gap-[10px]',
71+
containerHorizontal: 'w-[239px] flex items-center gap-[10px]',
7272
labelVertical: 'text-14 text-gray-500',
7373
labelHorizontal: 'text-14 text-gray-400 w-[60px] flex-shrink-0',
7474
base: 'px-[20px] py-[10px] h-[45px] w-[400px] rounded-md text-[14px] text-gray-500 placeholder:text-14 focus:outline-none mo:w-[355px]',

pages/signup/index.tsx

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useRouter } from 'next/router';
22
import { useState } from 'react';
3-
43
import Button from '@/components/Button';
54
import InputField from '@/components/Input';
5+
import Link from 'next/link';
66

77
function SignUp(): React.ReactElement {
88
const [email, setEmail] = useState('');
@@ -68,61 +68,63 @@ function SignUp(): React.ReactElement {
6868
return (
6969
<div className="flex min-h-screen items-center justify-center">
7070
<form onSubmit={handleSubmit}>
71-
<h1 className="mb-[64px] text-center text-24sb text-gray-500 mo:mb-[32px] ta:mb-[48px]">
72-
회원가입
73-
</h1>
74-
<InputField
75-
label="이름"
76-
type="name"
77-
value={name}
78-
onChange={handleNameChange}
79-
placeholder="이름을 입력해 주세요"
80-
onValidation={(isValid) => handleValidation('name', isValid)}
81-
/>
82-
83-
<InputField
84-
label="이메일"
85-
type="email"
86-
value={email}
87-
onChange={handleEmailChange}
88-
placeholder="이메일을 입력해 주세요"
89-
onValidation={(isValid) => handleValidation('email', isValid)}
90-
/>
91-
92-
<InputField
93-
label="비밀번호"
94-
type="password"
95-
value={password}
96-
onChange={handlePasswordChange}
97-
placeholder="비밀번호를 입력해 주세요"
98-
onValidation={(isValid) => handleValidation('password', isValid)}
99-
/>
100-
101-
<InputField
102-
label="비밀번호 확인"
103-
type="passwordConfirm"
104-
value={passwordConfirm}
105-
onChange={handlePasswordConfirmChange}
106-
placeholder="비밀번호를 다시 입력해 주세요"
107-
compareValue={password}
108-
onValidation={(isValid) =>
109-
handleValidation('passwordConfirm', isValid)
110-
}
111-
/>
112-
<Button
113-
type="submit"
114-
disabled={!isFormValid}
115-
isLoading={isSubmitting}
116-
variant="primary"
117-
className="mt-[30px] h-[45px] w-[400px] mo:w-[355px]"
118-
>
119-
가입하기
120-
</Button>
121-
<div className="mt-[40px] text-center">
122-
<span className="text-14 text-gray-400">이미 회원이신가요?</span>{' '}
123-
<a href="/login" className="text-14 text-green-300 hover:underline">
124-
로그인하기
125-
</a>
71+
<div className="flex flex-col items-center gap-[24px]">
72+
<h2 className="mb-[40px] text-center text-24sb text-gray-500 mo:mb-[8px] ta:mb-[24px]">
73+
회원가입
74+
</h2>
75+
<InputField
76+
label="이름"
77+
type="name"
78+
value={name}
79+
onChange={handleNameChange}
80+
placeholder="이름을 입력해 주세요"
81+
onValidation={(isValid) => handleValidation('name', isValid)}
82+
/>
83+
<InputField
84+
label="이메일"
85+
type="email"
86+
value={email}
87+
onChange={handleEmailChange}
88+
placeholder="이메일을 입력해 주세요"
89+
onValidation={(isValid) => handleValidation('email', isValid)}
90+
/>
91+
<InputField
92+
label="비밀번호"
93+
type="password"
94+
value={password}
95+
onChange={handlePasswordChange}
96+
placeholder="비밀번호를 입력해 주세요"
97+
onValidation={(isValid) => handleValidation('password', isValid)}
98+
/>
99+
<InputField
100+
label="비밀번호 확인"
101+
type="passwordConfirm"
102+
value={passwordConfirm}
103+
onChange={handlePasswordConfirmChange}
104+
placeholder="비밀번호를 다시 입력해 주세요"
105+
compareValue={password}
106+
onValidation={(isValid) =>
107+
handleValidation('passwordConfirm', isValid)
108+
}
109+
/>
110+
<Button
111+
type="submit"
112+
disabled={!isFormValid}
113+
isLoading={isSubmitting}
114+
variant="primary"
115+
className="mt-[30px] h-[45px] w-[400px] mo:w-[355px]"
116+
>
117+
가입하기
118+
</Button>
119+
<div className="mt-[40px] text-center">
120+
<span className="text-14 text-gray-400">이미 회원이신가요?</span>{' '}
121+
<Link
122+
href="/login"
123+
className="text-14 text-green-300 hover:underline"
124+
>
125+
로그인하기
126+
</Link>
127+
</div>{' '}
126128
</div>
127129
</form>
128130
</div>

0 commit comments

Comments
 (0)