Skip to content

Commit

Permalink
Feat(mogua-station#132): 프로필 이미지 영역 hover 인터렉션 개선
Browse files Browse the repository at this point in the history
- 이미지와 카메라 아이콘의 hover 효과를 통합
- 두 영역을 하나의 컴포넌트처럼 동작하도록 수정
  • Loading branch information
Stilllee committed Feb 7, 2025
1 parent e8e10c8 commit 7ab1db2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/edit-profile/ProfileImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -40,13 +45,12 @@ export default function ProfileImageInput({
}, [image, onImageSelect]);

return (
<div className='relative mb-6 mt-8'>
<div
className='relative cursor-pointer'
onClick={handleImageClick}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<div
className='relative mb-6 mt-8'
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<div className='relative cursor-pointer' onClick={handleImageClick}>
<Image
src={previewUrl || profileImg}
alt='프로필 이미지'
Expand Down

0 comments on commit 7ab1db2

Please sign in to comment.