-
Notifications
You must be signed in to change notification settings - Fork 4
[feat] PostCard 컴포넌트 생성 #43
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
✅ Deploy Preview for thejulge1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
cozy-ito
left a comment
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/Post/PostCard.tsx
Outdated
| const getPayRateText = (hourlyPay?: number, originalPay?: number): string => { | ||
| if (hourlyPay === undefined || originalPay === undefined) { | ||
| return ""; | ||
| } | ||
|
|
||
| const rawRate = ((hourlyPay - originalPay) / originalPay) * 100; | ||
| const displayRate = Math.min(Math.round(rawRate), 100); | ||
| return `기존 시급보다 ${displayRate}%`; | ||
| }; |
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.
Post 컴포넌트에도 거의 유사항 로직이 있었는데, 해당 로직을 util 함수로 분리해서 재사용하면 어떨까요? 🤔
src/components/Post/PostCard.tsx
Outdated
| import IconLocation from "@/assets/icon/location.svg?react"; | ||
| import IconTime from "@/assets/icon/time.svg?react"; | ||
| import IconArrow from "@/assets/icon/arrow-up.svg?react"; |
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.
| import IconLocation from "@/assets/icon/location.svg?react"; | |
| import IconTime from "@/assets/icon/time.svg?react"; | |
| import IconArrow from "@/assets/icon/arrow-up.svg?react"; | |
| import { Location, Time, ArrowUp } from "@/assets/icon"; |
수빈님께서 일괄 export를 해주셔서 위 처럼 아이콘을 사용할 수 있어요! 👍
src/components/Post/PostCard.tsx
Outdated
| {description} | ||
| </p> | ||
| </div> | ||
| {children && <div className="flex gap-2 mt-3">{children}</div>} |
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.
children prop에는 어떤 내용이 들어가면 되는건지 잘 모르겠어요 하핳 😅
코드를 천천히 살펴보니 버튼 요소가 들어가야 할 것 같긴 하네요! 🤔
PostCard 컴포넌트가 자식 요소로 가져갈 수 있는 것은 많은데,
이미 많은 부분을 위의 코드로 구체화하고 계셔서 어떤 요소가 children으로 전달되어야 할 지 직관적이지 않은 것 같아요 🥲
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.
코드 꼼꼼하게 리뷰해주셔서 감사합니다!😊 말씀해주신 부분들 참고하여 코드를 개선해보도록 하겠습니다!!
almighty55555
left a comment
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.
성진님께서 남겨주신 리뷰가 너무 좋네요! 다 잘 적용되어서 좋은 것 같습니다. 수고하셨습니다~
#️⃣연관된 이슈
📝 PR 유형
📝작업 내용
PostCard공통 컴포넌트 구현PostCard컴포넌트 페이지 작성스크린샷 (선택)
💬리뷰 요구사항(선택)