diff --git a/index.html b/index.html index ed735bad..3fc1531d 100644 --- a/index.html +++ b/index.html @@ -2,10 +2,13 @@
{field === 'email' && - !validate('email', inputValue) && - inputValue !== '' + inputValue !== '' && + !validate('email', inputValue) ? (errorMessage = '잘못된 이메일입니다') : field === 'nickname' && !validate('nickname', inputValue) && diff --git a/src/components/common/label/LabelType.ts b/src/components/common/label/LabelType.ts index 87b80821..8bb34d53 100644 --- a/src/components/common/label/LabelType.ts +++ b/src/components/common/label/LabelType.ts @@ -20,7 +20,7 @@ export const LabelColorVariant = { export const LabelTextColorVariant = { default: { - medium: 'stroke-blue-500 text-blue-500 ', + medium: 'stroke-blue-500 text-blue-500', small: 'text-white-0' }, selected: { diff --git a/src/components/common/profile/Profile.tsx b/src/components/common/profile/Profile.tsx index c56587bc..0e6d3617 100644 --- a/src/components/common/profile/Profile.tsx +++ b/src/components/common/profile/Profile.tsx @@ -19,27 +19,27 @@ const Profile = ({ const handleImageChange = (editId: number) => { if (imgRef.current && imgRef.current?.files) { + setImage(URL.createObjectURL(imgRef.current.files[0])) const formData = new FormData() formData.append('file', imgRef.current.files[0], 'myfile') - try { - request - .post(`/children/${editId}/profile`, formData, { - headers: { - 'Content-Type': 'multipart/form-data' - } - }) - .then((res) => { - setImage(res.data.profileImageUrl) + request + .post(`/children/${editId}/profile`, formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }) + .then(() => { + setToast({ + comment: '프로필 사진을 수정했어요.', + type: 'success' }) - .catch(() => { - setToast({ - comment: '파일 용량이 너무 커서 업로드를 실패했어요.', - type: 'error' - }) + }) + .catch(() => { + setToast({ + comment: '파일 용량이 너무 커서 업로드를 실패했어요.', + type: 'error' }) - } catch { - setToast({ comment: '파일 업로드를 실패했어요.', type: 'error' }) - } + }) } } return ( @@ -81,7 +81,7 @@ const Profile = ({ {imageLabel && (
{imageLabel}