File tree 2 files changed +15
-5
lines changed
src/apps/profiles/src/member-profile/tc-achievements
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ const MemberTCAchievements: FC<MemberTCAchievementsProps> = (props: MemberTCAchi
34
34
( badge : UserBadge ) => / T C O .* F i n a l i s t / . test ( badge . org_badge . badge_name ) ,
35
35
) . length || 0 , [ memberBadges ] )
36
36
37
+ const tcoTrips : number = useMemo ( ( ) => memberBadges ?. rows . filter (
38
+ ( badge : UserBadge ) => / T C O .* T r i p W i n n e r / . test ( badge . org_badge . badge_name ) ,
39
+ ) . length || 0 , [ memberBadges ] )
40
+
37
41
const isCopilot : boolean
38
42
= useMemo ( ( ) => ! ! memberStats ?. COPILOT , [ memberStats ] )
39
43
@@ -53,8 +57,8 @@ const MemberTCAchievements: FC<MemberTCAchievementsProps> = (props: MemberTCAchi
53
57
54
58
< div className = { styles . achievementsWrap } >
55
59
{
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 } />
58
62
)
59
63
}
60
64
{
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import styles from './TCOWinsBanner.module.scss'
5
5
interface TCOWinsBannerProps {
6
6
tcoWins : number
7
7
tcoQualifications : number
8
+ tcoTrips : number
8
9
}
9
10
10
11
const TCOWinsBanner : FC < TCOWinsBannerProps > = ( props : TCOWinsBannerProps ) => (
@@ -13,18 +14,23 @@ const TCOWinsBanner: FC<TCOWinsBannerProps> = (props: TCOWinsBannerProps) => (
13
14
< p className = 'body-large-bold' > Topcoder Open (TCO)</ p >
14
15
< p className = { styles . wins } >
15
16
{
16
- props . tcoWins === 1 || props . tcoQualifications === 1 ? (
17
+ props . tcoWins === 1 || props . tcoQualifications === 1 || props . tcoTrips === 1 ? (
17
18
< > </ >
18
19
) : (
19
20
< >
20
- { props . tcoWins || props . tcoQualifications }
21
+ { props . tcoWins || props . tcoQualifications || props . tcoTrips }
21
22
{ ' ' }
22
23
< span > time</ span >
23
24
</ >
24
25
)
25
26
}
26
27
</ 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 >
28
34
< p >
29
35
Topcoder Open (TCO) is the ultimate programming tournament,
30
36
that earns our winners major prestige in the programming community.
You can’t perform that action at this time.
0 commit comments