Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mosu-app/src/widgets/competition/InfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const InfoSection = () => {
<section className={styles.competition_info_section}>
<article className={styles.competition_info_section__title}>
<Image src={imgParticle} alt="" className={styles.competition_info_section__particle} />
<h2>우리 학교에서 신청자가 제일 많으면,</h2>
<h2>우리 학교에서 신청수가 제일 많으면,</h2>
<h1>우리 학교 전원 전액 환급</h1>
</article>

Expand All @@ -38,10 +38,10 @@ export const InfoSection = () => {
/>
<RankInfoCard
imgSrc={imgRank3}
rank={"6~10위"}
rank={"6~20위"}
descriptions={["전원 치킨", "기프티콘"]}
value={"0"}
delimiter={""}
value={"1"}
delimiter={"마리"}
/>
</ul>
</section>
Expand Down
20 changes: 16 additions & 4 deletions mosu-app/src/widgets/competition/RankTableSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,28 @@ export const RankTableSection = ({ topRatedSchools }: RankTableSectionProps) =>
);
}

const prevSchoolCount = topRatedSchools[index - 1].paidApplicationCount;
const gap = prevSchoolCount - school.paidApplicationCount;
const prevRank = index;
let targetRank: number;
let targetSchoolCount: number;

if (rank >= 2 && rank <= 5) {
targetRank = 1;
targetSchoolCount = topRatedSchools[0].paidApplicationCount;
} else if (rank >= 6 && rank <= 20) {
targetRank = 5;
targetSchoolCount = topRatedSchools[4]?.paidApplicationCount || 0;
} else {
targetRank = 20;
targetSchoolCount = topRatedSchools[19]?.paidApplicationCount || 0;
}

const gap = targetSchoolCount - school.paidApplicationCount;

return (
<RankTableRow
key={school.schoolName}
rank={rank}
schoolName={school.schoolName}
prevRank={prevRank}
prevRank={targetRank}
gap={gap}
/>
);
Expand Down