diff --git a/src/components/edit-profile/ProfileImageInput.tsx b/src/components/edit-profile/ProfileImageInput.tsx index c4b81ff4..f3b6fddb 100644 --- a/src/components/edit-profile/ProfileImageInput.tsx +++ b/src/components/edit-profile/ProfileImageInput.tsx @@ -21,7 +21,12 @@ export default function ProfileImageInput({ const handleCameraclick = (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - inputRef.current?.click(); + if (previewUrl) { + handleImageDelete(); + onImageSelect(null); + } else { + inputRef.current?.click(); + } }; const handleImageClick = () => { @@ -40,13 +45,12 @@ export default function ProfileImageInput({ }, [image, onImageSelect]); return ( -
-
setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - > +
setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + > +