Skip to content

Commit 5bdd704

Browse files
authored
Merge pull request #857 from topcoder-platform/release-hotfixes
MP-332 TCO trip winners -> dev
2 parents 475df25 + f1ceab4 commit 5bdd704

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/apps/profiles/src/member-profile/tc-achievements/MemberTCAchievements.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const MemberTCAchievements: FC<MemberTCAchievementsProps> = (props: MemberTCAchi
3434
(badge: UserBadge) => /TCO.*Finalist/.test(badge.org_badge.badge_name),
3535
).length || 0, [memberBadges])
3636

37+
const tcoTrips: number = useMemo(() => memberBadges?.rows.filter(
38+
(badge: UserBadge) => /TCO.*Trip Winner/.test(badge.org_badge.badge_name),
39+
).length || 0, [memberBadges])
40+
3741
const isCopilot: boolean
3842
= useMemo(() => !!memberStats?.COPILOT, [memberStats])
3943

@@ -53,8 +57,8 @@ const MemberTCAchievements: FC<MemberTCAchievementsProps> = (props: MemberTCAchi
5357

5458
<div className={styles.achievementsWrap}>
5559
{
56-
(tcoWins > 0 || tcoQualifications > 0) && (
57-
<TCOWinsBanner tcoWins={tcoWins} tcoQualifications={tcoQualifications} />
60+
(tcoWins > 0 || tcoQualifications > 0 || tcoTrips > 0) && (
61+
<TCOWinsBanner tcoWins={tcoWins} tcoQualifications={tcoQualifications} tcoTrips={tcoTrips} />
5862
)
5963
}
6064
{

src/apps/profiles/src/member-profile/tc-achievements/TCOWinsBanner/TCOWinsBanner.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import styles from './TCOWinsBanner.module.scss'
55
interface TCOWinsBannerProps {
66
tcoWins: number
77
tcoQualifications: number
8+
tcoTrips: number
89
}
910

1011
const TCOWinsBanner: FC<TCOWinsBannerProps> = (props: TCOWinsBannerProps) => (
@@ -13,18 +14,23 @@ const TCOWinsBanner: FC<TCOWinsBannerProps> = (props: TCOWinsBannerProps) => (
1314
<p className='body-large-bold'>Topcoder Open (TCO)</p>
1415
<p className={styles.wins}>
1516
{
16-
props.tcoWins === 1 || props.tcoQualifications === 1 ? (
17+
props.tcoWins === 1 || props.tcoQualifications === 1 || props.tcoTrips === 1 ? (
1718
<></>
1819
) : (
1920
<>
20-
{props.tcoWins || props.tcoQualifications}
21+
{props.tcoWins || props.tcoQualifications || props.tcoTrips}
2122
{' '}
2223
<span>time</span>
2324
</>
2425
)
2526
}
2627
</p>
27-
<p className={styles.champText}>{props.tcoWins ? 'Champion' : 'Finalist'}</p>
28+
<p className={styles.champText}>
29+
{
30+
props.tcoWins
31+
? 'Champion' : (props.tcoQualifications ? 'Finalist' : 'Trip Winner')
32+
}
33+
</p>
2834
<p>
2935
Topcoder Open (TCO) is the ultimate programming tournament,
3036
that earns our winners major prestige in the programming community.

0 commit comments

Comments
 (0)