[Feature/review] 업체 상세 리뷰 드로어 도입 및 Google 리뷰 출처 표기 적용#206
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the company review display by extracting the review list logic into a shared CompanyReviewListContent component, which is now utilized by both the main review page and a newly introduced CompanyReviewDrawer. The changes also include support for displaying review sources (e.g., Google Reviews) and adding localized strings for English, Japanese, and Korean. Feedback focuses on removing redundant client-side filtering that duplicates server-side logic, localizing the hardcoded "Google Reviews" label, and improving the "My Country Only" filter behavior when a user's country is unknown. Additionally, specific localization improvements were suggested for the Japanese and Korean translations of the "More" button.
| const filteredReviews = useMemo(() => { | ||
| let list = reviewList; | ||
|
|
||
| if (withPhotos) { | ||
| list = list.filter((review) => (review.image_urls?.length ?? 0) > 0); | ||
| } | ||
|
|
||
| if (myCountryOnly && country) { | ||
| list = list.filter((review) => review.customer_country === country); | ||
| } | ||
|
|
||
| return list; | ||
| }, [reviewList, withPhotos, myCountryOnly, country]); |
There was a problem hiding this comment.
The local filtering logic here is redundant because the queryParams (lines 32-41) already include these filter criteria (with_photos, my_country_only, country), which are passed to the infinite query. Since this is an infinite scroll implementation, client-side filtering can lead to inconsistent results or empty pages if the server-side pagination doesn't align perfectly with the client-side filter. It is better to rely solely on the server-side filtering provided by the API.
const filteredReviews = reviewList;
| "reviewImageAlt": "리뷰 이미지 {index}", | ||
| "googleSourceNotice": "* 이 리뷰는 {source}에서 수집되었어요.", | ||
| "moreOptions": "더보기", | ||
| "viewMore": "More", |
| "reviewImageAlt": "レビュー画像 {index}", | ||
| "googleSourceNotice": "* このレビューは{source}から収集されました。", | ||
| "moreOptions": "その他のオプション", | ||
| "viewMore": "More", |
|
|
||
| const GUEST_REVIEW_SOURCE_LABELS: Record<GuestReviewSource, string | null> = { | ||
| in_app: null, | ||
| google: 'Google Reviews', |
There was a problem hiding this comment.
| type="button" | ||
| css={[filterToggle, myCountryOnly && filterToggleActive]} | ||
| onClick={() => setMyCountryOnly((prev) => !prev)} | ||
| > | ||
| <Check width={14} height={14} /> | ||
| <Text typo="button_S" color={myCountryOnly ? 'primary50' : 'text_secondary'}> | ||
| {t('myCountryOnly')} | ||
| </Text> | ||
| </button> |
There was a problem hiding this comment.
📝 관련 문서 레퍼런스
💻 주요 변경 사항은 무엇인가요?
📚 추가된 라이브러리
📱 결과 화면 (선택)
🙇 코드 리뷰 중점사항, 예상되는 문제점 (선택)