File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/apps/profiles/src/member-profile/tc-achievements Expand file tree Collapse file tree 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
3434 ( badge : UserBadge ) => / T C O .* F i n a l i s t / . test ( badge . org_badge . badge_name ) ,
3535 ) . length || 0 , [ memberBadges ] )
3636
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+
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 {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import styles from './TCOWinsBanner.module.scss'
55interface TCOWinsBannerProps {
66 tcoWins : number
77 tcoQualifications : number
8+ tcoTrips : number
89}
910
1011const 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.
You can’t perform that action at this time.
0 commit comments