-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/67/mypage #76
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
Feat/67/mypage #76
Conversation
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-fzmfgdtgot.chromatic.com/ |
yulrang
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.
μκ³ νμ ¨μ΅λλ€~~~
Walkthroughμ΄λ² λ³κ²½ μ¬νμ Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MyPage
participant WritableGatheringCard
participant ReviewingModal
User->>MyPage: ν΄λ¦νμ¬ ν μ ν
MyPage->>WritableGatheringCard: λ°μ΄ν° μμ²
WritableGatheringCard->>User: μΉ΄λ λͺ©λ‘ νμ
User->>WritableGatheringCard: λ²νΌ ν΄λ¦
WritableGatheringCard->>ReviewingModal: λͺ¨λ¬ μ΄κΈ°
ReviewingModal->>User: 리뷰 μ
λ ₯ μμ²
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-yrlcxuvirc.chromatic.com/ |
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.
Actionable comments posted: 2
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (5)
src/app/(crew)/mypage/_components/profile-card/presenter.tsx(1 hunks)src/app/(crew)/mypage/page.tsx(2 hunks)src/components/common/writable-gathering-card/writable-gathering-card.tsx(3 hunks)src/mock/writable-gathering-data.ts(1 hunks)src/types/writable-gathering-card.d.ts(1 hunks)
β Files skipped from review due to trivial changes (1)
- src/app/(crew)/mypage/_components/profile-card/presenter.tsx
π Additional comments (9)
src/components/common/writable-gathering-card/writable-gathering-card.tsx (2)
1-1: λͺ¨λ¬ μν κ΄λ¦¬ ꡬνμ΄ μ μ ν©λλ€.
λͺ¨λ¬ μ»΄ν¬λνΈ importμ μν κ΄λ¦¬ ꡬνμ΄ Reactμ κ΄νμ μ λ°λ₯΄κ³ μμ΅λλ€.
Also applies to: 7-7, 39-39
43-45: νλ‘ν μ΄λ―Έμ§ μμ±λͺ
λ³κ²½ κ²μ¦μ΄ νμν©λλ€.
imageUrlμμ profileImageUrlλ‘μ μμ±λͺ
λ³κ²½μ΄ νμΈλμμ΅λλ€. μ΄ λ³κ²½μ΄ λ€λ₯Έ μ»΄ν¬λνΈμλ μν₯μ λ―ΈμΉ μ μμ΅λλ€.
λ€μ μ€ν¬λ¦½νΈλ‘ κ΄λ ¨ μ½λλ₯Ό νμΈνκ² μ΅λλ€:
β Verification successful
Let me analyze the search results. I can see that:
-
The
imageUrlproperty is used in different contexts:- For gathering/crew images in components like
gathering-card,writable-gathering-card - For profile images in mock data and types
- For gathering/crew images in components like
-
The
profileImageUrlproperty is consistently used for user profiles across:- User types (
auth.ts,user.d.ts) - Participant types (
writable-gathering-card.d.ts) - Mock data for participants
- User types (
-
The specific change in
writable-gathering-card.tsxis mapping participant data whereprofileImageUrlis the source property andimageUrlis the target property.
Given this analysis, I can now provide the final response:
νλ‘ν μ΄λ―Έμ§ μμ±λͺ λ³κ²½μ μ¬λ°λ₯΄κ² μ μ©λμμ΅λλ€.
imageUrlκ³Ό profileImageUrlμ μλ‘ λ€λ₯Έ λͺ©μ μΌλ‘ μ¬μ©λκ³ μμ΅λλ€:
imageUrl: λͺ¨μ/ν¬λ£¨μ λν μ΄λ―Έμ§profileImageUrl: μ¬μ©μ νλ‘ν μ΄λ―Έμ§
νμ¬ λ³κ²½μ¬νμ μ°Έμ¬μμ νλ‘ν μ΄λ―Έμ§(profileImageUrl)λ₯Ό μΉ΄λ μ»΄ν¬λνΈμ μ΄λ―Έμ§(imageUrl)λ‘ λ§€ννλ κ²μ΄λ―λ‘, λ€λ₯Έ μ»΄ν¬λνΈμ μν₯μ μ£Όμ§ μμ΅λλ€.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: νλ‘ν μ΄λ―Έμ§ μμ±λͺ
μ¬μ© κ²μ¦
# imageUrl μμ± μ¬μ© κ²μ
echo "imageUrl μμ± μ¬μ© κ²μ:"
rg "imageUrl.*?:" -A 2
# profileImageUrl μμ± μ¬μ© κ²μ
echo "\nprofileImageUrl μμ± μ¬μ© κ²μ:"
rg "profileImageUrl.*?:" -A 2
Length of output: 63457
src/app/(crew)/mypage/page.tsx (5)
9-13: μλ‘μ΄ μ»΄ν¬λνΈμ νμ
μν¬νΈκ° μ μ ν μΆκ°λμμ΅λλ€.
WritableGatheringCardList μ»΄ν¬λνΈμ κ΄λ ¨ νμ μ΄ κΉλνκ² μΆκ°λμμ΅λλ€.
29-33: λ³μλͺ
μ΄ λͺ
ννκ² κ°μ λμμ΅λλ€.
리뷰 κ΄λ ¨ λ°μ΄ν° νμΉ λ³μλ€μ μ΄λ¦μ΄ λ ꡬ체μ μΌλ‘ λ³κ²½λμ΄ μ½λμ κ°λ μ±μ΄ ν₯μλμμ΅λλ€.
40-51: λͺ¨μ λ°μ΄ν° νμΉ λ‘μ§ κ²ν κ° νμν©λλ€.
μλ‘ μΆκ°λ λͺ¨μ λ°μ΄ν° νμΉ λ‘μ§μ΄ 리뷰 λ°μ΄ν° νμΉκ³Ό μ μ¬ν ꡬ쑰λ₯Ό κ°μ§κ³ μμ΄ μ’μ΅λλ€. νμ§λ§ λ€μ μ¬νλ€μ νμΈν΄ μ£ΌμκΈ° λ°λλλ€:
- νμ΄μ§λΉ μμ΄ν μ(3)κ° νλμ½λ©λμ΄ μμ΅λλ€.
- μλ¬ μ²λ¦¬ λ‘μ§μ΄ μμ΅λλ€.
λ€μκ³Ό κ°μ κ°μ μ μ μλ립λλ€:
const {
data: gatheringData,
ref: gatheringRef,
isFetchingNextPage: isFetchingGatheringNextPage,
+ error,
} = useInfiniteScroll<WritableGatheringCardInformResponse>({
queryKey: ['crew'],
queryFn: ({ pageParam = 0 }) => {
- return fetchWritableGatheringData(pageParam, 3);
+ const ITEMS_PER_PAGE = 3;
+ try {
+ return fetchWritableGatheringData(pageParam, ITEMS_PER_PAGE);
+ } catch (error) {
+ console.error('λͺ¨μ λ°μ΄ν° λ‘λ© μ€ μ€λ₯ λ°μ:', error);
+ throw error;
+ }
},
getNextPageParam: (lastPage, allPages) =>
lastPage.hasNextPage ? allPages.length + 1 : undefined,
});67-73: WritableGatheringCardList ꡬνμ΄ μ μ ν©λλ€.
κΈ°μ‘΄ div νλ μ΄μ€νλκ° μ€μ μ»΄ν¬λνΈλ‘ κ΅μ²΄λμκ³ , νμν propsκ° μ¬λ°λ₯΄κ² μ λ¬λκ³ μμ΅λλ€.
77-77: μ€νμΌ ν΄λμ€ μ λ¦¬κ° μ λμμ΅λλ€.
λΆνμν shadow-bg ν΄λμ€κ° μ κ±°λμ΄ μ€νμΌμ΄ λ κΉλν΄μ‘μ΅λλ€.
src/mock/writable-gathering-data.ts (2)
6-6: νλ‘ν μ΄λ―Έμ§ μμ±λͺ
μ΄ λͺ
ννκ² λ³κ²½λμμ΅λλ€!
imageUrlμμ profileImageUrlλ‘μ λ³κ²½μ ν΄λΉ μμ±μ λͺ©μ μ λ λͺ
ννκ² ννν©λλ€.
Also applies to: 11-11, 16-16
Line range hint 29-29: μμ±λͺ
μΌκ΄μ± κ²ν κ° νμν©λλ€.
WritableGatheringData κ°μ²΄λ€μμλ μ¬μ ν imageUrlμ μ¬μ©νκ³ μμ΅λλ€. λͺ¨μ μ΄λ―Έμ§μ νλ‘ν μ΄λ―Έμ§κ° λ€λ₯Έ λͺ©μ μΌλ‘ μ¬μ©λλ κ²μ΄ λ§λμ§ νμΈμ΄ νμν©λλ€.
Also applies to: 39-39, 50-50, 61-61, 72-72, 83-83, 94-94, 105-105, 116-116, 127-127, 138-138, 149-149, 160-160
β Verification successful
imageUrlκ³Ό profileImageUrl μμ±μ μλμ μΌλ‘ ꡬλΆλμ΄ μ¬μ©λκ³ μμ΅λλ€
μ½λλ² μ΄μ€ λΆμ κ²°κ³Ό, λ μμ±μ λͺ νν λ€λ₯Έ λͺ©μ μΌλ‘ μ¬μ©λκ³ μμ΅λλ€:
-
imageUrl: λͺ¨μ/ν¬λ£¨μ λν μ΄λ―Έμ§λ₯Ό λνλ΄λ μμ±GatheringData,WritableGatheringDataλ± λͺ¨μ κ΄λ ¨ νμ μμ μ¬μ©- λͺ¨μ μΉ΄λλ μμΈ νμ΄μ§μ μ»€λ² μ΄λ―Έμ§λ‘ νμ©
-
profileImageUrl: μ¬μ©μμ νλ‘ν μ΄λ―Έμ§λ₯Ό λνλ΄λ μμ±Userνμ κ³Ό μ°Έμ¬μ μ 보μμ μ¬μ©- νλ‘ν μ»΄ν¬λνΈμ μ°Έμ¬μ λͺ©λ‘μμ νμ©
λ°λΌμ μμ±λͺ μ μ°¨μ΄λ μλμ μΈ μ€κ³μ΄λ©°, μΌκ΄μ± μκ² μ μ©λμ΄ μμ΅λλ€.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: νμ
μ μμμ imageUrl μμ±μ μ©λ νμΈ
# Test: WritableGatheringCardInform νμ
μμ imageUrl μμ± νμΈ
ast-grep --pattern 'interface WritableGatheringCardInform {
$$$
imageUrl: $_
$$$
}'
# Test: λ€λ₯Έ μ»΄ν¬λνΈμμ μ΄λ―Έμ§ μμ± μ¬μ© ν¨ν΄ νμΈ
rg "imageUrl|profileImageUrl" -t typescript -t tsx
Length of output: 179
Script:
#!/bin/bash
# μ΄λ―Έμ§ κ΄λ ¨ μμ± μ¬μ© ν¨ν΄ νμΈ
rg "imageUrl|profileImageUrl" --type-add 'ts:*.{ts,tsx}' -t ts
# WritableGatheringData νμ
μ μ νμΈ
ast-grep --pattern 'type WritableGatheringData = {
$$$
}'
# GatheringData νμ
μ μ νμΈ
ast-grep --pattern 'type GatheringData = {
$$$
}'
# λͺ¨μ κ΄λ ¨ μ»΄ν¬λνΈμμ μ΄λ―Έμ§ μμ± μ¬μ© νμΈ
rg "imageUrl|profileImageUrl" --type-add 'ts:*.{ts,tsx}' -t ts -g '*gathering*.{ts,tsx}'
Length of output: 30532
| export type ParticipantType = { | ||
| id: number; | ||
| imageUrl: string; | ||
| profileImageUrl: string; |
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.
π‘ Codebase verification
imageUrl μμ±μ΄ μΌκ΄λμ§ μκ² μ¬μ©λκ³ μμ΅λλ€.
μ½λλ² μ΄μ€μμ participant.profileImageUrlμ imageUrl νλ‘νΌν°λ‘ λ§€ννλ λΆλΆμ΄ λ°κ²¬λμμ΅λλ€:
src/components/common/writable-gathering-card/writable-gathering-card.tsxμμ:imageUrl: participant.profileImageUrl,
src/app/(crew)/crew/_components/gathering-detail-modal/presenter.tsxμμ:<Profile imageUrl={participant?.profileImageUrl} />
Profile μ»΄ν¬λνΈμ propsμ λ§€ν λ‘μ§μμλ μΌκ΄λ λ€μ΄λ°μ μ¬μ©νλλ‘ μμ μ΄ νμν©λλ€.
π Analysis chain
μμ± μ΄λ¦ λ³κ²½μ΄ μΌκ΄μ± μκ² μ μ©λμμ΅λλ€.
imageUrlμμ profileImageUrlλ‘μ λ³κ²½μ΄ νμ
μ μμ μ λ°μλμμ΅λλ€. μ΄λ λ λͺ
ννκ³ μΌκ΄λ λ€μ΄λ° 컨벀μ
μ λ°λ₯΄κ³ μμ΅λλ€.
μ΄ λ³κ²½μ¬νμ΄ μ 체 μ½λλ² μ΄μ€μμ μΌκ΄λκ² μ μ©λμλμ§ νμΈνκ² μ΅λλ€:
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify all occurrences of the old property name have been updated
# Expected: No occurrences of the old property name 'imageUrl' in participant-related contexts
# Search for any remaining instances of 'imageUrl'
rg -A 3 'imageUrl.*participant|participant.*imageUrl'
# Search for the new property name to confirm proper usage
rg -A 3 'profileImageUrl.*participant|participant.*profileImageUrl'
Length of output: 1853
| <Button | ||
| className="bg-blue-500 p-[6px_14px] text-base font-semibold text-white" | ||
| onClick={() => setIsModalOpened(true)} | ||
| > | ||
| 리뷰 μμ±νκΈ° | ||
| </Button> | ||
| </div> | ||
| <ReviewingModal | ||
| opened={isModalOpened} | ||
| close={() => { | ||
| setIsModalOpened((prev) => !prev); | ||
| }} | ||
| /> |
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.
π οΈ Refactor suggestion
λͺ¨λ¬ λ«κΈ° λ‘μ§ κ°μ μ΄ νμν©λλ€.
λͺ¨λ¬ λ«κΈ° ν¨μμμ λΆνμν μ΄μ μν μ°Έμ‘°κ° μμ΅λλ€.
λ€μκ³Ό κ°μ΄ κ°μ νλ κ²μ μ μλ립λλ€:
- close={() => {
- setIsModalOpened((prev) => !prev);
- }}
+ close={() => setIsModalOpened(false)}μ΄μ :
- λͺ¨λ¬μ λ«μ λλ μ΄μ μνλ₯Ό νμΈν νμ μμ΄ μ§μ
falseλ‘ μ€μ νλ κ²μ΄ λ λͺ νν©λλ€ - νμ¬ κ΅¬νμ ν κΈ λ°©μμ΄λΌ μλμΉ μμ λμμ΄ λ°μν μ μμ΅λλ€
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <Button | |
| className="bg-blue-500 p-[6px_14px] text-base font-semibold text-white" | |
| onClick={() => setIsModalOpened(true)} | |
| > | |
| 리뷰 μμ±νκΈ° | |
| </Button> | |
| </div> | |
| <ReviewingModal | |
| opened={isModalOpened} | |
| close={() => { | |
| setIsModalOpened((prev) => !prev); | |
| }} | |
| /> | |
| <Button | |
| className="bg-blue-500 p-[6px_14px] text-base font-semibold text-white" | |
| onClick={() => setIsModalOpened(true)} | |
| > | |
| 리뷰 μμ±νκΈ° | |
| </Button> | |
| </div> | |
| <ReviewingModal | |
| opened={isModalOpened} | |
| close={() => setIsModalOpened(false)} | |
| /> |
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-chgvtzvbqr.chromatic.com/ |
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.
Actionable comments posted: 1
π§Ή Outside diff range and nitpick comments (2)
src/components/common/writable-gathering-card/writable-gathering-card.tsx (2)
73-76: μ κ·Όμ± κ°μ μ΄ νμν©λλ€.λ²νΌμ aria-labelμ μΆκ°νμ¬ μ€ν¬λ¦° 리λ μ¬μ©μμ μ κ·Όμ±μ κ°μ νλ κ²μ΄ μ’κ² μ΅λλ€.
<Button className="bg-blue-500 p-[6px_14px] text-base font-semibold text-white" onClick={() => setIsModalOpened(true)} + aria-label="λͺ¨μ 리뷰 μμ±νκΈ°" >
80-85: μλ¬ μ²λ¦¬ κ°μ μ΄ νμν©λλ€.λͺ¨λ¬ μ»΄ν¬λνΈμ ErrorBoundaryλ₯Ό μΆκ°νμ¬ μκΈ°μΉ μμ μ€λ₯λ‘λΆν° μ ν리μΌμ΄μ μ 보νΈνλ κ²μ΄ μ’κ² μ΅λλ€.
+import ErrorBoundary from '@/src/components/common/error-boundary'; // ... - <ReviewingModal - opened={isModalOpened} - close={() => { - setIsModalOpened(false); - }} - /> + <ErrorBoundary fallback={<div>리뷰 λͺ¨λ¬μ λΆλ¬μ€λ μ€ μ€λ₯κ° λ°μνμ΅λλ€.</div>}> + <ReviewingModal + opened={isModalOpened} + close={() => { + setIsModalOpened(false); + }} + /> + </ErrorBoundary>
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (1)
src/components/common/writable-gathering-card/writable-gathering-card.tsx(3 hunks)
π Additional comments (1)
src/components/common/writable-gathering-card/writable-gathering-card.tsx (1)
1-1: λͺ¨λ¬ κ΄λ ¨ μν κ΄λ¦¬κ° μ ꡬνλμμ΅λλ€!
useStateλ₯Ό μ¬μ©ν λͺ¨λ¬ μν κ΄λ¦¬μ import κ΅¬λ¬Έμ΄ κΉλνκ² κ΅¬νλμμ΅λλ€.
Also applies to: 7-7, 39-39
| id: participant.id, | ||
| nickname: participant.nickname, | ||
| profileImageUrl: participant.imageUrl, | ||
| imageUrl: participant.profileImageUrl, |
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.
π‘ Codebase verification
νλ‘ν μ΄λ―Έμ§ μμ±λͺ λ³κ²½μ΄ μΌκ΄μ± μκ² μ μ©λμ΄μΌ ν©λλ€.
μ½λλ² μ΄μ€ λΆμ κ²°κ³Ό, imageUrlκ³Ό profileImageUrlμ΄ κ°κ° λ€λ₯Έ λͺ©μ μΌλ‘ μ¬μ©λκ³ μμ΅λλ€:
profileImageUrl: μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μν μμ±imageUrl: λͺ¨μ, ν¬λ£¨, 리뷰 λ±μ λν μ΄λ―Έμ§λ₯Ό μν μμ±
λ€μ νμΌλ€μμ νλ‘ν μ΄λ―Έμ§ κ΄λ ¨ μμ±λͺ
μ profileImageUrlλ‘ ν΅μΌν΄μΌ ν©λλ€:
src/components/common/review-list/review-card.tsx:reviewer?.imageUrlβreviewer?.profileImageUrlsrc/components/common/profile/index.tsx:imageUrlβprofileImageUrlsrc/components/common/crew-list/profiles.stories.tsx:imageUrlβprofileImageUrl
π Analysis chain
νλ‘ν μ΄λ―Έμ§ μμ±λͺ λ³κ²½μ λν κ²μ¦μ΄ νμν©λλ€.
imageUrlμμ profileImageUrlλ‘μ λ³κ²½μ΄ λ€λ₯Έ μ»΄ν¬λνΈμλ μΌκ΄λκ² μ μ©λμλμ§ νμΈμ΄ νμν©λλ€.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: νλ‘ν μ΄λ―Έμ§ μμ±λͺ
μ¬μ© κ²μ¦
# κΈ°λ κ²°κ³Ό: imageUrl λμ profileImageUrlμ΄ μΌκ΄λκ² μ¬μ©λμ΄μΌ ν¨
echo "νλ‘ν μ΄λ―Έμ§ μμ± μ¬μ© νν© νμΈ:"
rg "imageUrl|profileImageUrl" --type ts --type tsx
Length of output: 131
Script:
#!/bin/bash
# Description: νλ‘ν μ΄λ―Έμ§ μμ±λͺ
μ¬μ© κ²μ¦ (μμ λ λͺ
λ Ήμ΄)
echo "νλ‘ν μ΄λ―Έμ§ μμ± μ¬μ© νν© νμΈ:"
# TypeScript/React νμΌμμ κ²μ
fd "\.(ts|tsx)$" | xargs rg "imageUrl|profileImageUrl"
# ASTλ₯Ό ν΅ν μμ± μ¬μ© ν¨ν΄ κ²μ
ast-grep --pattern 'imageUrl: $_'
ast-grep --pattern 'profileImageUrl: $_'
Length of output: 21881
π Issue Ticket
Ticket
βοΈ Description
λ§μ΄νμ΄μ§μ λλ€
β Checklist
PR
Test
Summary by CodeRabbit
μλ‘μ΄ κΈ°λ₯
λ²κ·Έ μμ