-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] following 이미지 및 navigate 추가 #115
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
Changes from 5 commits
ee58bdb
b7c4566
b2733dd
50dab27
be11964
90dfce6
6cc3087
88e15e5
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 |
|---|---|---|
| @@ -1,31 +1,36 @@ | ||
| import Image from 'next/image'; | ||
| import { useRouter } from 'next/navigation'; | ||
|
|
||
| import { cn } from '@/lib/utils'; | ||
|
|
||
| interface FollowingCardProps { | ||
| id: number; | ||
| name: string; | ||
| profileImage: string; | ||
| profileMessage: string; | ||
| type: 'following' | 'message'; | ||
| count?: number; | ||
| onClick?: () => void; | ||
| onMessageClick?: () => void; | ||
| } | ||
|
|
||
| export const FollowingCard = ({ | ||
| id, | ||
| name, | ||
| profileImage, | ||
| profileMessage, | ||
| type, | ||
| count = 0, | ||
| onClick, | ||
| onMessageClick, | ||
| }: FollowingCardProps) => { | ||
| const router = useRouter(); | ||
| const handleClick = () => { | ||
| router.push(`/profile/${id}`); | ||
| }; | ||
| return ( | ||
| <div | ||
|
Member
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. 지금 카드가 div로 되어 있는데, 스크린리더에서는 텍스트 콘텐츠만 알리고 클릭 가능한 요소로 인식이 안되거나, 키보드(Tab, Enter, Space 등)으로 접근이 어려울 수 있어요.
Contributor
Author
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. 좋은 지적 감사합니다!! |
||
| data-testid='following-card' | ||
| className='flex cursor-pointer items-center gap-3 bg-white p-5' | ||
| onClick={onClick} | ||
| onClick={handleClick} | ||
| > | ||
| <Image | ||
| width={48} | ||
|
|
||
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.
id, name, profileImage가 다 동일하다면 공통으로 묶는 것도 코드도 짧아지고 수정도 쉬워져서 좋을 거 같아요.