File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
src/apps/profiles/src/member-profile/tc-achievements Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -29,21 +29,25 @@ const MemberTCAchievements: FC<MemberTCAchievementsProps> = (props: MemberTCAchi
2929 ( badge : UserBadge ) => / T C O .* C h a m p i o n / . test ( badge . org_badge . badge_name ) ,
3030 ) . length || 0 , [ memberBadges ] )
3131
32+ const tcoQualifications : number = useMemo ( ( ) => memberBadges ?. rows . filter (
33+ ( badge : UserBadge ) => / T C O .* F i n a l i s t / . test ( badge . org_badge . badge_name ) ,
34+ ) . length || 0 , [ memberBadges ] )
35+
3236 const isCopilot : boolean
3337 = useMemo ( ( ) => ! ! memberStats ?. COPILOT , [ memberStats ] )
3438
3539 // function handleOpenTCAchievements(): void {
3640 // console.log('handleOpenTCAchievements')
3741 // }
3842
39- return memberStats ?. wins || tcoWins ? (
43+ return memberStats ?. wins || tcoWins || tcoQualifications ? (
4044 < div className = { styles . container } >
4145 < p className = 'body-large-medium' > Achievements @ Topcoder</ p >
4246
4347 < div className = { styles . achievementsWrap } >
4448 {
45- tcoWins > 0 && (
46- < TCOWinsBanner tcoWins = { tcoWins } />
49+ ( tcoWins > 0 || tcoQualifications > 0 ) && (
50+ < TCOWinsBanner tcoWins = { tcoWins } tcoQualifications = { tcoQualifications } />
4751 )
4852 }
4953 {
Original file line number Diff line number Diff line change @@ -4,25 +4,26 @@ import styles from './TCOWinsBanner.module.scss'
44
55interface TCOWinsBannerProps {
66 tcoWins : number
7+ tcoQualifications : number
78}
89
910const TCOWinsBanner : FC < TCOWinsBannerProps > = ( props : TCOWinsBannerProps ) => (
1011 < div className = { styles . container } >
1112 < p className = 'body-large-bold' > Topcoder Open (TCO)</ p >
1213 < p className = { styles . wins } >
1314 {
14- props . tcoWins === 1 ? (
15+ props . tcoWins === 1 || props . tcoQualifications === 1 ? (
1516 < > </ >
1617 ) : (
1718 < >
18- { props . tcoWins }
19+ { props . tcoWins || props . tcoQualifications }
1920 { ' ' }
2021 < span > times</ span >
2122 </ >
2223 )
2324 }
2425 </ p >
25- < p className = { styles . champText } > Champion</ p >
26+ < p className = { styles . champText } > { props . tcoWins ? ' Champion' : 'Finalist' } </ p >
2627 < p className = { styles . text } >
2728 Topcoder Open (TCO) is the ultimate programming tournament,
2829 that earns our winners major prestige in the programming community.
You can’t perform that action at this time.
0 commit comments