Skip to content

Commit

Permalink
chore: 코드 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
wokbjso committed Nov 26, 2024
1 parent c01dc4b commit bbb1da4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,14 @@ export function RecommendedProfileCard({
</Link>
<div className={css(ProfileCardStyle.followButton.raw({ variant }))}>
{!isMyProfile && (
<>
{isFollowing ? (
<Button
size="small"
label="팔로잉"
variant="outlined"
buttonType="assistive"
className={css({ w: 'full' })}
onClick={handleClickFollow}
/>
) : (
<Button
size="small"
label="팔로우"
variant="outlined"
buttonType="primary"
className={css({ w: 'full' })}
onClick={handleClickFollow}
/>
)}
</>
<Button
size="small"
label={isFollowing ? '팔로잉' : '팔로우'}
variant="outlined"
buttonType={isFollowing ? 'assistive' : 'primary'}
className={css({ w: 'full' })}
onClick={handleClickFollow}
/>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export function RecommendedProfileItem({
const { data: myData } = useCurrentMemberInfo();
const { data: profileData } = useProfileData(memberId);

const getIsMyProfile = (memberId: number) => {
if (!myData?.data) return false;
const myMemberId = myData?.data.id;
return myMemberId === memberId;
};
const getIsMyProfile = myData?.data?.id === memberId;

if (!profileData) return null;
return (
Expand All @@ -25,7 +21,7 @@ export function RecommendedProfileItem({
nickname={profileData?.nickname}
introduction={profileData?.introduction}
profileImageUrl={profileData.profileImageUrl}
isMyProfile={getIsMyProfile(memberId)}
isMyProfile={getIsMyProfile}
/>
);
}

0 comments on commit bbb1da4

Please sign in to comment.