Skip to content

Commit 3b35bae

Browse files
committed
TC&You init - tracks
1 parent 4d7648e commit 3b35bae

File tree

18 files changed

+215
-0
lines changed

18 files changed

+215
-0
lines changed

src/apps/accounts/src/lib/assets/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './security'
22
export * from './preferences'
33
export * from './payments'
44
export * from './tools'
5+
export * from './tcandyou'
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ReactComponent as DevelopmentTrackIcon } from './develop.svg'
2+
import { ReactComponent as DesignTrackIcon } from './design.svg'
3+
import { ReactComponent as DataScienceTrackIcon } from './data_science.svg'
4+
5+
export {
6+
DesignTrackIcon,
7+
DataScienceTrackIcon,
8+
DevelopmentTrackIcon,
9+
}

src/apps/accounts/src/settings/tabs/AccountSettingsTabs.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AccountTab } from './account'
99
import { PreferencesTab } from './preferences'
1010
import { PaymentsTab } from './payments'
1111
import { ToolsTab } from './tools'
12+
import { TCandYouTab } from './tcandyou'
1213
import styles from './AccountSettingsTabs.module.scss'
1314

1415
interface AccountSettingsTabsProps {
@@ -45,6 +46,10 @@ const AccountSettingsTabs: FC<AccountSettingsTabsProps> = (props: AccountSetting
4546
'Topcoder'].join(' | ')}
4647
</PageTitle>
4748

49+
{activeTab === AccountSettingsTabViews.tcandyou && (
50+
<TCandYouTab profile={props.profile} memberTraits={memberTraits} />
51+
)}
52+
4853
{activeTab === AccountSettingsTabViews.tools && (
4954
<ToolsTab profile={props.profile} memberTraits={memberTraits} />
5055
)}

src/apps/accounts/src/settings/tabs/config/account-settings-tabs-config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ export enum AccountSettingsTabViews {
55
account = '1',
66
preferences = '2',
77
payment = '3',
8+
tcandyou = '4',
89
}
910

1011
export const AccountSettingsTabsConfig: TabsNavItem[] = [
12+
{
13+
id: AccountSettingsTabViews.tcandyou,
14+
title: 'Topcoder & You',
15+
},
1116
{
1217
id: AccountSettingsTabViews.tools,
1318
title: 'Tools',
@@ -28,6 +33,7 @@ export const AccountSettingsTabsConfig: TabsNavItem[] = [
2833

2934
export function getHashFromTabId(tabId: string): string {
3035
switch (tabId) {
36+
case AccountSettingsTabViews.tcandyou: return '#tcandyou'
3137
case AccountSettingsTabViews.tools: return '#tools'
3238
case AccountSettingsTabViews.account: return '#account'
3339
case AccountSettingsTabViews.preferences: return '#preferences'
@@ -38,6 +44,7 @@ export function getHashFromTabId(tabId: string): string {
3844

3945
export function getTabIdFromHash(hash: string): string {
4046
switch (hash) {
47+
case '#tcandyu': return AccountSettingsTabViews.tcandyou
4148
case '#tools': return AccountSettingsTabViews.tools
4249
case '#account': return AccountSettingsTabViews.account
4350
case '#preferences': return AccountSettingsTabViews.preferences
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@import '@libs/ui/styles/includes';
2+
3+
.container {
4+
background-color: $black-5;
5+
padding: $sp-6;
6+
margin: $sp-8 0;
7+
border-radius: 6px;
8+
9+
@include ltelg {
10+
padding: $sp-4;
11+
}
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { FC } from 'react'
2+
3+
import { UserProfile, UserTraits } from '~/libs/core'
4+
5+
import { Tracks } from './tracks'
6+
import styles from './TCandYouTab.module.scss'
7+
8+
interface TCandYouTabProps {
9+
profile: UserProfile
10+
memberTraits: UserTraits[] | undefined
11+
}
12+
13+
const TCandYouTab: FC<TCandYouTabProps> = (props: TCandYouTabProps) => (
14+
<div className={styles.container}>
15+
<h3>You And Topcoder</h3>
16+
17+
<Tracks profile={props.profile} />
18+
</div>
19+
)
20+
21+
export default TCandYouTab
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as TCandYouTab } from './TCandYouTab'

0 commit comments

Comments
 (0)