-
Notifications
You must be signed in to change notification settings - Fork 0
댓글 컴포넌트의 스타일 버그 해결 #315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
댓글 컴포넌트의 스타일 버그 해결 #315
Changes from all commits
ec9e373
2a65e94
e4eb576
272786e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,10 @@ import usePostReply from '../../../../hooks/user/CommentHooks/usePostReply'; | |
| import usePatchReply from '../../../../hooks/user/CommentHooks/usePatchReply'; | ||
| import usePostComment from '../../../../hooks/user/CommentHooks/usePostComment'; | ||
| import usePutComment from '../../../../hooks/user/CommentHooks/usePutComment'; | ||
| import { useMyProfileInfo } from '../../../../hooks/user/useMyInfo'; | ||
| import { formatImgPath } from '../../../../util/formatImgPath'; | ||
| import Avatar from '../../../common/avatar/Avatar'; | ||
| import DefaultImg from '../../../../assets/defaultImg.png'; | ||
|
|
||
| type FormValue = { | ||
| commentInput: string; | ||
|
|
@@ -38,7 +42,7 @@ const CommentInput = ({ | |
| register, | ||
| setValue, | ||
| } = useForm<FormValue>(); | ||
|
|
||
| const { myData } = useMyProfileInfo(); | ||
| const { isFocused, handleFocus, handleClick } = useInputFocus(); | ||
| const { createComment } = usePostComment(projectId); | ||
| const { changeComment } = usePutComment(projectId, commentId); | ||
|
|
@@ -47,6 +51,12 @@ const CommentInput = ({ | |
|
|
||
| const hasInput = Boolean(watch('commentInput', '')); | ||
|
|
||
| const profileImg = myData?.profileImg | ||
| ? `${import.meta.env.VITE_APP_IMAGE_CDN_URL}/${formatImgPath( | ||
| myData.profileImg | ||
| )}?w=86&h=86&fit=crop&crop=entropy&auto=format,enhance&q=60` | ||
| : DefaultImg; | ||
|
Comment on lines
+54
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain환경변수 의존성과 이미지 처리 로직을 검증해주세요. 프로필 이미지 URL 생성 로직이 잘 구현되었지만, 몇 가지 확인이 필요합니다:
🏁 Script executed: #!/bin/bash
# 환경변수 사용 현황과 formatImgPath 함수 구현 확인
echo "=== 환경변수 사용 현황 ==="
rg -n "VITE_APP_IMAGE_CDN_URL"
echo "=== formatImgPath 함수 구현 ==="
cat src/util/formatImgPath.tsLength of output: 713 🏁 Script executed: #!/bin/bash
# DefaultImg 위치와 사용 맥락 확인
echo "=== DefaultImg 사용 ==="
rg -n "DefaultImg" -A3 src/components
# CommentInput 컴포넌트 내 <img> 태그 및 onError 핸들러 확인
echo "=== CommentInput.tsx <img> ==="
rg -n "<img" -A3 src/components/user/comment/commentInput/CommentInput.tsxLength of output: 2430 🏁 Script executed: #!/bin/bash
# avatar 디렉토리 파일 목록 확인
echo "=== avatar 디렉토리 목록 ==="
ls src/components/common/avatar
# Avatar.tsx 구현 확인
echo "=== Avatar.tsx 내용 ==="
cat src/components/common/avatar/Avatar.tsx
# onError 핸들러 확인
echo "=== Avatar.tsx onError 핸들러 ==="
rg -n "onError" -A3 src/components/common/avatar/Avatar.tsx || echo "No onError handler found"Length of output: 1048 프로필 이미지 URL 생성 및 로딩 실패 대응
수정 제안:
<S.AvatarImg
src={releasedImg}
+ onError={(e) => { e.currentTarget.src = defaultImg; }}
alt='Avatar'
/>
🤖 Prompt for AI Agents |
||
|
|
||
| const handleSubmit = (data: { commentInput: string }) => { | ||
| if (reply) { | ||
| if (activateEditMode) { | ||
|
|
@@ -75,6 +85,7 @@ const CommentInput = ({ | |
|
|
||
| return ( | ||
| <S.InputContainer> | ||
| <Avatar size={'55px'} image={profileImg} /> | ||
| <S.InputWrapper> | ||
| <form | ||
| onSubmit={ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
사용자 데이터 로딩에 대한 에러 처리를 확인해주세요.
useMyProfileInfohook에서 반환하는 데이터가 로딩 중이거나 에러가 발생할 경우에 대한 처리가 필요할 수 있습니다. 현재는myData만 사용하고 있지만, 로딩 상태나 에러 상태도 고려해보세요.🏁 Script executed:
Length of output: 812
에러 및 로딩 상태 핸들링 추가 필요
현재
useMyProfileInfo훅이myData와isLoading만 반환해, 컴포넌트에서 에러 상태를 처리할 수 없습니다. 아래를 참고해 수정하세요.🤖 Prompt for AI Agents