Skip to content

Commit

Permalink
refactor: activity 필드 내부 값에 대한 가드
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo committed Dec 16, 2024
1 parent 64c2341 commit ed217c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/members/main/MemberList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,12 @@ const MemberList: FC<MemberListProps> = ({ banner }) => {
<React.Fragment key={index}>
{profiles.map((profile) => {
const sorted = profile.activities.sort((a, b) => b.generation - a.generation);
const badges = sorted.map((activity) => ({
content: `${activity.generation}${activity.part}`,
isActive: activity.generation === LATEST_GENERATION,
}));
const badges = sorted
.filter((activity) => activity.generation && activity.part)
.map((activity) => ({
content: `${activity.generation}${activity.part}`,
isActive: activity.generation === LATEST_GENERATION,
}));

const belongs = profile.careers.find((career) => career.isCurrent)?.companyName ?? profile.university;

Expand Down

0 comments on commit ed217c7

Please sign in to comment.