Skip to content

Commit

Permalink
fix: change to component outside filterSeveralMajor
Browse files Browse the repository at this point in the history
  • Loading branch information
yougyung committed Apr 27, 2024
1 parent 7829983 commit 63a0933
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app/ui/result/result-category/result-category-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ interface ResultCategoryCardProps {
completed?: boolean;
}

const filterSeveralMajor = (category: ResultCategoryKey) => {
const { DUAL_MANDATORY_MAJOR, DUAL_ELECTIVE_MAJOR, DUAL_BASIC_ACADEMICAL_CULTURE, SUB_MAJOR } = RESULT_CATEGORY;

switch (category) {
case DUAL_MANDATORY_MAJOR:
case DUAL_ELECTIVE_MAJOR:
case DUAL_BASIC_ACADEMICAL_CULTURE:
return <Button label="복수전공" variant="outlined" size="xs" />;
case SUB_MAJOR:
return <Button label="부전공" variant="outlined" size="xs" />;
default:
return <></>;
}
};

function ResultCategoryCard({ category, totalCredit, takenCredit }: ResultCategoryCardProps) {
const { toggle } = useDialog(DIALOG_KEY.RESULT_CATEGORY);

const percentage = Number(((takenCredit / totalCredit) * 100).toFixed(0));

const filterSeveralMajor = (category: ResultCategoryKey) => {
const { DUAL_MANDATORY_MAJOR, DUAL_ELECTIVE_MAJOR, DUAL_BASIC_ACADEMICAL_CULTURE, SUB_MAJOR } = RESULT_CATEGORY;

switch (category) {
case DUAL_MANDATORY_MAJOR:
case DUAL_ELECTIVE_MAJOR:
case DUAL_BASIC_ACADEMICAL_CULTURE:
return <Button label="복수전공" variant="outlined" size="xs" />;
case SUB_MAJOR:
return <Button label="부전공" variant="outlined" size="xs" />;
default:
return <></>;
}
};

return (
<div
className={cn('flex flex-col gap-6 zIndex-1 rounded-xl shadow-lg bg-white p-[0.4rem]', 'md:w-80 md:p-[1.8rem]')}
Expand Down

0 comments on commit 63a0933

Please sign in to comment.