diff --git a/frontend/src/components/AuthForm/InputBox.jsx b/frontend/src/components/AuthForm/InputBox.jsx
index 0e5da9d..d7786f9 100644
--- a/frontend/src/components/AuthForm/InputBox.jsx
+++ b/frontend/src/components/AuthForm/InputBox.jsx
@@ -1,7 +1,19 @@
-import { forwardRef } from 'react';
+import { forwardRef, useState } from 'react';
import styles from './InputBox.module.css';
-export default forwardRef(function InputBox({ title, id = null, type, hasError = null, children }, ref) {
+export default forwardRef(function InputBox(
+ { title, id = null, type, hasError = null, children, maxLength = 50 },
+ ref
+) {
+ const [isMaxLengthReached, setIsMaxLengthReached] = useState(false);
+
+ const handleInput = (e) => {
+ if (e.target.value.length >= maxLength) {
+ setIsMaxLengthReached(true);
+ } else {
+ setIsMaxLengthReached(false);
+ }
+ };
return (
+ {isMaxLengthReached &&
최대 {maxLength}자까지 입력 가능합니다
}
{children}
);
diff --git a/frontend/src/components/InfoEditForm/InfoEditForm.jsx b/frontend/src/components/InfoEditForm/InfoEditForm.jsx
index fb82762..30f41d2 100644
--- a/frontend/src/components/InfoEditForm/InfoEditForm.jsx
+++ b/frontend/src/components/InfoEditForm/InfoEditForm.jsx
@@ -27,7 +27,7 @@ export default function InfoEditForm({ name, email, onSubmit, usingEmail }) {
placeholder="이름"
type="text"
id="username"
- maxLength={200}
+ maxLength={20}
className={`${styles.input} ${styles.textBody}`}
value={username}
onChange={(e) => setUsername(e.target.value)}
@@ -48,7 +48,7 @@ export default function InfoEditForm({ name, email, onSubmit, usingEmail }) {
id="useremail"
className={`${styles.input} ${styles.textBody} ${usingEmail && styles.errorBox}`}
value={useremail}
- maxLength={200}
+ maxLength={50}
onChange={(e) => setUseremail(e.target.value)}
required
/>
diff --git a/frontend/src/components/PasswordChangeForm/PasswordChangeForm.jsx b/frontend/src/components/PasswordChangeForm/PasswordChangeForm.jsx
index 0c204bf..2e0fe27 100644
--- a/frontend/src/components/PasswordChangeForm/PasswordChangeForm.jsx
+++ b/frontend/src/components/PasswordChangeForm/PasswordChangeForm.jsx
@@ -35,7 +35,7 @@ export default function PasswordChangeForm({ onSubmit, onError }) {
type="password"
id="currentPassword"
ref={currentPasswordRef}
- maxLength={200}
+ maxLength={20}
className={error === 'currentPwError' ? styles.inputErrorBox : styles.inputBox}
required
/>
@@ -47,7 +47,7 @@ export default function PasswordChangeForm({ onSubmit, onError }) {
type="password"
id="newPassword"
ref={newPasswordRef}
- maxLength={200}
+ maxLength={20}
className={error === 'samePwError' ? styles.inputErrorBox : styles.inputBox}
required
/>
@@ -59,7 +59,7 @@ export default function PasswordChangeForm({ onSubmit, onError }) {
type="password"
id="confirmPassword"
ref={confirmPasswordRef}
- maxLength={200}
+ maxLength={20}
className={error === 'confirmError' ? styles.inputErrorBox : styles.inputBox}
required
/>
diff --git a/frontend/src/pages/LoginPage/LoginPage.jsx b/frontend/src/pages/LoginPage/LoginPage.jsx
index fada596..f0bc5a0 100644
--- a/frontend/src/pages/LoginPage/LoginPage.jsx
+++ b/frontend/src/pages/LoginPage/LoginPage.jsx
@@ -52,12 +52,14 @@ export default function LoginPage() {
id="id"
type="text"
ref={idRef}
+ maxLength={20}
/>
+ {}
{error === 'existingId' && 이미 존재하는 아이디입니다
}
{error === 'pwNotMatch' && 비밀번호가 일치하지 않습니다
}