File tree Expand file tree Collapse file tree 5 files changed +20
-13
lines changed
Expand file tree Collapse file tree 5 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default function ChangePassword() {
1212 const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
1313
1414 const isPasswordMismatch =
15- newPassword && checkNewpassword && newPassword !== checkNewpassword ;
15+ ! ! checkNewpassword && checkNewpassword !== newPassword ;
1616 const isDisabled =
1717 ! password ||
1818 ! newPassword ||
@@ -88,10 +88,15 @@ export default function ChangePassword() {
8888 placeholder = "새 비밀번호 입력"
8989 value = { checkNewpassword }
9090 onChange = { ( value ) => setCheckNewPassword ( value ) }
91- forceInvalid = { ! ! checkNewpassword && checkNewpassword !== newPassword }
91+ forceInvalid = { isPasswordMismatch }
9292 invalidMessage = "비밀번호가 일치하지 않습니다."
9393 className = "max-w-[624px]"
9494 />
95+ { checkNewpassword && checkNewpassword !== newPassword && (
96+ < p className = "font-14r block text-[var(--color-red)]" >
97+ 비밀번호가 일치하지 않습니다.
98+ </ p >
99+ ) }
95100
96101 < button
97102 className = { `w-full h-[54px]
@@ -106,12 +111,6 @@ export default function ChangePassword() {
106111 >
107112 변경
108113 </ button >
109-
110- { checkNewpassword && checkNewpassword !== newPassword && (
111- < p className = "font-14r block text-[var(--color-red)]" >
112- 비밀번호가 일치하지 않습니다.
113- </ p >
114- ) }
115114 </ div >
116115 </ div >
117116 ) ;
Original file line number Diff line number Diff line change @@ -26,8 +26,16 @@ export default function ProfileCard() {
2626 const handleImageUpload = async (
2727 event : React . ChangeEvent < HTMLInputElement >
2828 ) => {
29+ const MAX_IMAGE_SIZE = 3.5 * 1024 * 1024 ;
30+
2931 if ( event . target . files && event . target . files [ 0 ] ) {
3032 const file = event . target . files [ 0 ] ;
33+
34+ if ( file . size > MAX_IMAGE_SIZE ) {
35+ toast . error ( "3.5MB 이하의 이미지만 업로드할 수 있습니다." ) ;
36+ return ;
37+ }
38+
3139 setPreview ( URL . createObjectURL ( file ) ) ; // 미리보기
3240
3341 try {
@@ -42,6 +50,7 @@ export default function ProfileCard() {
4250 }
4351 }
4452 } ;
53+
4554 const handleSave = async ( ) => {
4655 if ( ! nickname || ! image ) return ;
4756
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ const CustomToastContainer = () => {
66 return (
77 < ToastContainer
88 position = "top-center"
9- autoClose = { 1500 }
9+ autoClose = { 3000 }
10+ newestOnTop
1011 closeButton = { false }
1112 pauseOnHover = { false }
12- newestOnTop
13+ hideProgressBar = { true }
1314 transition = { Slide }
1415 />
1516 ) ;
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export default function Input(props: InputProps) {
3939 className,
4040 labelClassName,
4141 wrapperClassName,
42+ forceInvalid,
4243 ...rest
4344 } = props as SignInputProps ;
4445
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { getUserInfo } from "@/api/users";
55import { postAuthData } from "@/api/auth" ;
66import Link from "next/link" ;
77import Input from "@/components/input/Input" ;
8- import { apiRoutes } from "@/api/apiRoutes" ;
98import { toast } from "react-toastify" ;
109
1110export default function LoginPage ( ) {
@@ -28,8 +27,6 @@ export default function LoginPage() {
2827 const { email, password } = values ;
2928
3029 try {
31- // 배포 테스트
32- console . log ( "로그인 요청 URL:" , apiRoutes . login ( ) ) ;
3330 const response = await postAuthData ( { email, password } ) ;
3431 const token = response . accessToken ;
3532 localStorage . setItem ( "accessToken" , token ) ;
You can’t perform that action at this time.
0 commit comments