Skip to content

Commit

Permalink
chore: 프로필 수정 모달 가독성을 위한 코드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhyojeong committed Jan 31, 2024
1 parent e01a786 commit 30bcbb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/shop/EditProfileModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ export const EditProfileModal = ({
onClose,
onConfirm
}: EditProfileModalProps): ReactElement => {
const validateNickname = useValidateNickname()

const [profileForm, setProfileForm] = useState<EditProfileForm>(profile)
const [nickNameValidate, setNickNameValidate] = useState(
initialNickNameValidate
)
const validateNickname = useValidateNickname()
const createUploadImage = useCreateUploadImagesMutation()
const canEdit = nickNameValidate.isSuccess || profileForm.image.file

const handleChangeProfileImage = async (
image: EditProfileForm['image']
Expand All @@ -60,9 +58,11 @@ export const EditProfileModal = ({
}

const { uploaderRef, openUploader, changeImage } = useImageUploader({
onChange: async image => handleChangeProfileImage(image)
onChange: handleChangeProfileImage
})

const canEdit = nickNameValidate.isSuccess || profileForm.image.file

const handleChangeNickname: ChangeEventHandler<HTMLInputElement> = e => {
setProfileForm({ ...profileForm, nickname: e.target.value })
}
Expand Down

0 comments on commit 30bcbb5

Please sign in to comment.