Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ProfileCard({ data, onEdit }: ProfileCardProps) {
<Profile size="full" imageUrl={data?.profileImageUrl ?? ''} />
</figure>
<div className="flex flex-col gap-2">
<p className="text-2xl font-semibold text-gray-900">{data?.nickname} λ‹˜, μ•ˆλ…•ν•˜μ„Έμš”</p>
<p className="text-2xl font-semibold text-gray-900">{data?.nickname} λ‹˜, μ•ˆλ…•ν•˜μ„Έμš”πŸ™Œ</p>
<dl className="flex text-base font-medium text-gray-700">
<dt className="flex-shrink-0 flex-grow-0 basis-20">Email</dt>
<dd className="flex-1">{data?.email}</dd>
Expand Down
38 changes: 32 additions & 6 deletions src/app/(crew)/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { useInfiniteScroll } from '@/src/hooks/useInfiniteScroll';
import ProfileCardContainer from '@/src/app/(crew)/mypage/_components/profile-card/container';
import ReviewCardList from '@/src/components/common/review-list/review-card-list';
import Tabs from '@/src/components/common/tab';
import WritableGatheringCardList from '@/src/components/common/writable-gathering-card/writable-gathering-card-list';
import { ReviewInformResponse } from '@/src/types/review';
import { WritableGatheringCardInformResponse } from '@/src/types/writable-gathering-card';
import { fetchMyReviewData } from '../../api/mock-api/review';
import { fetchWritableGatheringData } from '../api/mock-api/writable-gathering';

const mockData = {
id: 1,
Expand All @@ -23,32 +26,55 @@ export default function MyPage() {
];
const [currentTab, setCurrentTab] = useState(myPageTabs[0].id);

const { data, ref, isFetchingNextPage } = useInfiniteScroll<ReviewInformResponse>({
const {
data: reviewData,
ref: reviewRef,
isFetchingNextPage: isFetchingReviewNextPage,
} = useInfiniteScroll<ReviewInformResponse>({
queryKey: ['review'],
queryFn: ({ pageParam = 0 }) => fetchMyReviewData(pageParam, 3),
getNextPageParam: (lastPage, allPages) =>
lastPage.hasNextPage ? allPages.length + 1 : undefined,
});

const {
data: gatheringData,
ref: gatheringRef,
isFetchingNextPage: isFetchingGatheringNextPage,
} = useInfiniteScroll<WritableGatheringCardInformResponse>({
queryKey: ['crew'],
queryFn: ({ pageParam = 0 }) => {
return fetchWritableGatheringData(pageParam, 3);
},
getNextPageParam: (lastPage, allPages) =>
lastPage.hasNextPage ? allPages.length + 1 : undefined,
});

const renderTabContent = () => {
// TODO : 리턴 κ°’ μ»΄ν¬λ„ŒνŠΈλ‘œ ꡐ체
switch (currentTab) {
case 'my-review':
return (
<ReviewCardList
data={data}
ref={ref}
isFetchingNextPage={isFetchingNextPage}
data={reviewData}
ref={reviewRef}
isFetchingNextPage={isFetchingReviewNextPage}
isMine
clickable
/>
);
default:
return <div>μž‘μ„± κ°€λŠ₯ν•œ 리뷰 리슀트 μ»΄ν¬λ„ŒνŠΈ</div>;
return (
<WritableGatheringCardList
data={gatheringData}
isFetchingNextPage={isFetchingGatheringNextPage}
ref={gatheringRef}
/>
);
}
};
return (
<div className="container mx-auto my-0 min-h-screen max-w-pc bg-gray-50 px-3 py-11 shadow-bg md:px-8 lg:px-11">
<div className="container mx-auto my-0 min-h-screen max-w-pc bg-gray-50 px-3 py-11 md:px-8 lg:px-11">
<div className="lg:gap-4.5 flex flex-col gap-3 md:gap-4">
<ProfileCardContainer data={mockData} />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useState } from 'react';
import Image from 'next/image';
import Profiles from '@/src/components/common/crew-list/profiles';
import Button from '@/src/components/common/input/button';
import { ParticipantType } from '@/src/types/writable-gathering-card';
import person from '@/public/assets/icons/person.svg';
import ReviewingModal from '../../my-page/reviewing-modal/reviewing-modal';

interface WritableGatheringCardProps {
id: number;
Expand Down Expand Up @@ -34,12 +36,13 @@ export default function WritableGatheringCard({
participants,
totalCount,
}: WritableGatheringCardProps) {
const [isModalOpened, setIsModalOpened] = useState(false);
const { year, month, day } = formatDateWithYear(dateTime);

const profiles = participants.map((participant) => ({
id: participant.id,
nickname: participant.nickname,
profileImageUrl: participant.imageUrl,
imageUrl: participant.profileImageUrl,
Comment on lines 43 to +45
Copy link

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?.profileImageUrl
  • src/components/common/profile/index.tsx: imageUrl β†’ profileImageUrl
  • src/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

}));

return (
Expand Down Expand Up @@ -67,10 +70,19 @@ export default function WritableGatheringCard({
</div>
<div className="text-sm font-medium text-gray-700">{`${year}λ…„ ${month}μ›” ${day}일`}</div>
</div>
<Button className="bg-blue-500 p-[6px_14px] text-base font-semibold text-white">
<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);
}}
/>
</div>
);
}
6 changes: 3 additions & 3 deletions src/mock/writable-gathering-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { ParticipantType, WritableGatheringCardInform } from '@/src/types/writab
export const Participants: ParticipantType[] = [
{
id: 1,
imageUrl: 'https://i.pinimg.com/564x/eb/12/71/eb127155bde0e2826b2b92c25456a622.jpg',
profileImageUrl: 'https://i.pinimg.com/564x/eb/12/71/eb127155bde0e2826b2b92c25456a622.jpg',
nickname: '읡λͺ…1',
},
{
id: 2,
imageUrl: 'https://i.pinimg.com/564x/a5/b7/5a/a5b75a92e49cec6e67d2130179c7d84d.jpg',
profileImageUrl: 'https://i.pinimg.com/564x/a5/b7/5a/a5b75a92e49cec6e67d2130179c7d84d.jpg',
nickname: '읡λͺ…2',
},
{
id: 3,
imageUrl: 'https://i.pinimg.com/736x/13/ad/a1/13ada1a3dbb6c57f8fec1c386ea31546.jpg',
profileImageUrl: 'https://i.pinimg.com/736x/13/ad/a1/13ada1a3dbb6c57f8fec1c386ea31546.jpg',
nickname: '읡λͺ…3',
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/types/writable-gathering-card.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export type WritableGatheringCardInform = {

export type ParticipantType = {
id: number;
imageUrl: string;
profileImageUrl: string;
Copy link

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

nickname: string;
};