Skip to content

Commit 11f4bfe

Browse files
authored
Merge pull request #955 from topcoder-platform/dev
feat: topcoder wallet app
2 parents ac38212 + 10c8603 commit 11f4bfe

File tree

145 files changed

+4238
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+4238
-66
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ workflows:
257257
branches:
258258
only:
259259
- dev
260-
- MP-356_member-stats-and-history
261260

262261
- deployQa:
263262
context: org-global

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ end_of_line = lf
1010
charset = utf-8
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
13+
quote_type = single

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"semi": false
3+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"prettier.requireConfig": true,
4+
"editor.formatOnSave": false
5+
}

craco.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = {
4343
'@gamificationAdmin': resolve('src/apps/gamification-admin/src'),
4444
'@talentSearch': resolve('src/apps/talent-search/src'),
4545
'@profiles': resolve('src/apps/profiles/src'),
46+
'@wallet': resolve('src/apps/wallet/src'),
4647

4748
'@platform': resolve('src/apps/platform/src'),
4849
// aliases used in SCSS files

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@storybook/react": "^7.0.5",
3131
"@stripe/react-stripe-js": "1.13.0",
3232
"@stripe/stripe-js": "1.41.0",
33+
"@tanstack/react-table": "^8.11.7",
3334
"@types/testing-library__jest-dom": "^5.14.5",
3435
"apexcharts": "^3.36.0",
3536
"axios": "^1.1.2",
@@ -85,6 +86,7 @@
8586
"react-helmet": "^6.1.0",
8687
"react-html-parser": "^2.0.2",
8788
"react-markdown": "8.0.6",
89+
"react-otp-input": "^3.1.1",
8890
"react-popper": "^2.3.0",
8991
"react-redux": "^8.0.4",
9092
"react-redux-toastr": "^7.6.10",

src/apps/platform/src/platform.routes.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ import { profilesRoutes } from '~/apps/profiles'
99
import { talentSearchRoutes } from '~/apps/talent-search'
1010
import { accountsRoutes } from '~/apps/accounts'
1111
import { onboardingRoutes } from '~/apps/onboarding'
12+
import { walletRoutes } from '~/apps/wallet'
1213

13-
const Home: LazyLoadedComponent = lazyLoad(() => import('./routes/home'), 'HomePage')
14+
const Home: LazyLoadedComponent = lazyLoad(
15+
() => import('./routes/home'),
16+
'HomePage',
17+
)
1418

1519
const homeRoutes: ReadonlyArray<PlatformRoute> = [
1620
{
@@ -32,6 +36,7 @@ export const platformRoutes: Array<PlatformRoute> = [
3236
...gamificationAdminRoutes,
3337
...talentSearchRoutes,
3438
...profilesRoutes,
39+
...walletRoutes,
3540
...accountsRoutes,
3641
...homeRoutes,
3742
]

src/apps/profiles/src/components/tc-achievements/MemberStatsBlock/MemberStatsBlock.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getRatingColor, MemberStats, UserProfile } from '~/libs/core'
66
import { IconOutline } from '~/libs/ui'
77

88
import { useFetchActiveTracks } from '../../../hooks'
9-
import { WinnerIcon } from '../../../lib'
9+
import { formatPlural, WinnerIcon } from '../../../lib'
1010
import { MemberProfileContextValue, useMemberProfileContext } from '../../../member-profile/MemberProfile.context'
1111

1212
import styles from './MemberStatsBlock.module.scss'
@@ -45,30 +45,25 @@ const MemberStatsBlock: FC<MemberStatsBlockProps> = props => {
4545
<div className={styles.trackDetails}>
4646
{!track.isDSTrack && ((track.submissions || track.wins) > 0) && (
4747
<>
48-
<WinnerIcon className='icon-xxxl' />
48+
{track.wins > 0 && (
49+
<WinnerIcon className='icon-xxxl' />
50+
)}
4951
<span className={styles.trackStats}>
5052
<span className={styles.count}>
5153
{track.wins || track.submissions}
5254
</span>
5355
<span className={styles.label}>
54-
{track.wins > 0 ? 'Wins' : 'Submissions'}
56+
{formatPlural(
57+
track.wins || track.submissions || 0,
58+
track.wins > 0 ? 'Win' : 'Submission',
59+
)}
5560
</span>
5661
</span>
5762
</>
5863
)}
5964
{/* competitive programming only */}
6065
{track.isDSTrack && (
61-
(track.percentile as number) >= 50 ? (
62-
<span className={styles.trackStats}>
63-
<span className={styles.count}>
64-
{track.percentile}
65-
%
66-
</span>
67-
<span className={styles.label}>
68-
Percentile
69-
</span>
70-
</span>
71-
) : (
66+
(track.isCPTrack || (track.percentile as number) < 50) ? (
7267
<>
7368
<span
7469
className={styles.icon}
@@ -83,6 +78,16 @@ const MemberStatsBlock: FC<MemberStatsBlockProps> = props => {
8378
</span>
8479
</span>
8580
</>
81+
) : (
82+
<span className={styles.trackStats}>
83+
<span className={styles.count}>
84+
{track.percentile}
85+
%
86+
</span>
87+
<span className={styles.label}>
88+
Percentile
89+
</span>
90+
</span>
8691
)
8792
)}
8893
<IconOutline.ChevronRightIcon

src/apps/profiles/src/components/tc-achievements/StatsSummaryBlock/StatsSummaryBlock.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { find, get } from 'lodash'
44

55
import { getRatingColor } from '~/libs/core'
66

7-
import { numberToFixed } from '../../../lib'
7+
import { formatPlural, numberToFixed } from '../../../lib'
88
import { TracksSummaryStats } from '../../../config'
99

1010
import styles from './StatsSummaryBlock.module.scss'
@@ -49,7 +49,10 @@ const StatsSummaryBlock: FC<StatsSummaryBlockProps> = props => {
4949
</span>
5050
<span className={styles.summaryItemLabel}>
5151
<span className='body-small'>
52-
{props.trackTitle === 'Single Round Match' ? 'Competitions' : 'Challenges'}
52+
{formatPlural(
53+
props.challenges || 0,
54+
props.trackTitle === 'Single Round Match' ? 'Competition' : 'Challenge',
55+
)}
5356
</span>
5457
</span>
5558
</div>
@@ -61,7 +64,7 @@ const StatsSummaryBlock: FC<StatsSummaryBlockProps> = props => {
6164
</span>
6265
<span className={styles.summaryItemLabel}>
6366
<span className='body-small'>
64-
Wins
67+
{formatPlural(props.wins || 0, 'Win')}
6568
</span>
6669
</span>
6770
</div>
@@ -73,7 +76,7 @@ const StatsSummaryBlock: FC<StatsSummaryBlockProps> = props => {
7376
</span>
7477
<span className={styles.summaryItemLabel}>
7578
<span className='body-small'>
76-
Submissions
79+
{formatPlural(props.submissions || 0, 'Submission')}
7780
</span>
7881
</span>
7982
</div>

src/apps/profiles/src/components/tc-achievements/SubTrackSummaryCard/SubTrackSummaryCard.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from 'classnames'
33

44
import { IconSolid } from '~/libs/ui'
55

6-
import { subTrackLabelToHumanName, WinnerIcon } from '../../../lib'
6+
import { formatPlural, subTrackLabelToHumanName, WinnerIcon } from '../../../lib'
77

88
import styles from './SubTrackSummaryCard.module.scss'
99

@@ -29,7 +29,9 @@ const SubTrackSummaryCard: FC<SubTrackSummaryCardProps> = props => (
2929
{props.wins}
3030
</span>
3131
<span className={styles.statsItemLabel}>
32-
<span className='label'>wins</span>
32+
<span className='label'>
33+
{formatPlural(props.wins || 0, 'Win')}
34+
</span>
3335
</span>
3436
</div>
3537
)}
@@ -38,7 +40,9 @@ const SubTrackSummaryCard: FC<SubTrackSummaryCardProps> = props => (
3840
{props.submissions}
3941
</span>
4042
<span className={styles.statsItemLabel}>
41-
<span className='label'>submissions</span>
43+
<span className='label'>
44+
{formatPlural(props.submissions || 0, 'Submission')}
45+
</span>
4246
</span>
4347
</div>
4448
</div>

0 commit comments

Comments
 (0)