-
Notifications
You must be signed in to change notification settings - Fork 0
[OD-165] 공통 컴포넌트 (TopBar, UserProfile, PostItem) 리팩토링 #111
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
Conversation
src/components/PostItem/index.tsx
Outdated
| const PostItem: React.FC<PostItemProps> = ({ post, isMyPost = true }) => { | ||
| const navigate = useNavigate(); | ||
| const imageUrl = post.imageUrl; | ||
| const PostImageUrl = post.imageUrl; |
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.
PostImageUrl을 의도하신 게 아니라면 postImageUrl로 수정해야 할 것 같습니다~
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.
수정 완료 했습니답 😅😅
src/components/PostItem/index.tsx
Outdated
| const handlePostClick = () => { | ||
| const path = isMyPost ? `/my-post/${post.id}` : `/post/${post.id}`; | ||
| navigate(path); | ||
| }; | ||
|
|
||
| return ( | ||
| <PostItemContainer onClick={handleClick}> | ||
| <PostItemLayout onClick={handlePostClick}> |
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.
요 이벤트 핸들러 이름으로 handlePostItemClick는 어떠신가요? PostItem 컴포넌트이기도 하고, 비록 서로 다른 파일로 분리되어 있기는 하지만 handlePostClick는 Post 컴포넌트 클릭으로 읽힐 여지가 있는 것 같아서 제안드립니다!
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.
좋은 제안이십니다 저도 고민했다가 분리돼 있으니 괜찮겠지...? 했는데 명확하게 할 필요가 있을 것 같아용 수정했습니다!!!!!!!!!!!!!!
src/components/PostItem/index.tsx
Outdated
|
|
||
| import theme from '@/styles/theme'; | ||
| import PinIcon from '@/assets/default/pin.svg'; | ||
| import Heart from '@components/Icons/Heart'; |
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.
제 기억에 Heart는 홈/피드에서 사용하는 좋아요 버튼입니다! 여기서 사용되는 컴포넌트는 Like일 것 같아용
src/components/TopBar/dto.ts
Outdated
| onLeftButtonClick?: () => void; | ||
| onRightButtonClick?: () => void; |
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.
변수명명규칙에 따르면 onClickLeftButton/onClickRightButton이 더 적합할 것 같습니다! 조금 헷갈릴 수 있지만,
컴포넌트 내에서 정의되는 이벤트 핸들러는 handle[대상][이벤트]이고,
ex. handleButtonClick -> 버튼 클릭을 처리하는 함수
props로 받아오는 이벤트 핸들러는 on[이벤트][대상]입니다!
ex. onClickButton -> 버튼에 대한 onClick 이벤트 리스너
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.
아오아오아오아오 죄송함니다 ㅠㅠ 좀 더 꼼꼼하게 살필게요
src/components/PostItem/index.tsx
Outdated
| import theme from '@/styles/theme'; | ||
| import PinIcon from '@/assets/default/pin.svg'; |
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.
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.
저 theme을 import 하면 기본적으로 @/styles로 import 되던데 styles와 assets만 @/이 아니라 @으로 직접 수정하면 될까용?? 우선 제 담당 컴포넌트의 경로들 수정해뒀습니다!!
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.
다른것들도다@로수정햇습니다.
주요 작업 내용
기타 작업 내용
코드 리뷰 포인트
작업 화면