Skip to content

회원 가입 placeholder 변경 및 validate 처리 강화 #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2024
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
6 changes: 3 additions & 3 deletions src/components/register/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
<LabelInput
name="displayName"
onChange={onChange}
label="이름"
placeholder="이름을 입력하세요"
label="프로필 이름"
placeholder="프로필 이름을 입력하세요. 프로필 설정에서 변경이 가능합니다."
value={form.displayName}
size={20}
/>
Expand All @@ -123,7 +123,7 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
name="username"
onChange={onChange}
label="사용자 ID"
placeholder="새 사용자 ID를 입력하세요"
placeholder="새 사용자 ID를 입력하세요. 변경이 불가능합니다."
value={form.username}
size={22}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/containers/register/RegisterFormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ const RegisterFormContainer: React.FC<RegisterFormContainerProps> = ({
// validate
const validation = {
displayName: (text: string) => {
if (text === '') {
if (text.trim() === '') {
return '이름을 입력해주세요.';
}
if (text.length > 45) {
if (text.trim().length > 45) {
return '이름은 최대 45자까지 입력 할 수 있습니다.';
}
},
username: (text: string) => {
if (!/^[a-z0-9-_]{3,16}$/.test(text)) {
return '아이디는 3~16자의 알파벳 소문자,숫자,혹은 - _ 으로 이루어져야 합니다.';
return '사용자 ID는 3~16자의 알파벳 소문자,숫자,혹은 - _ 으로 이루어져야 합니다.';
}
},
shortBio: (text: string) => {
Expand Down
1 change: 1 addition & 0 deletions src/lib/api/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const host =
process.env.NODE_ENV === 'development'
? '/'
: process.env.REACT_APP_API_HOST || '/';

const apiClient = axios.create({
baseURL: host,
withCredentials: true,
Expand Down