Skip to content

Commit 23964f3

Browse files
committed
MP-168 how skills work modal
1 parent 73c1954 commit 23964f3

File tree

6 files changed

+149
-17
lines changed

6 files changed

+149
-17
lines changed

src/apps/profiles/src/config/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const TC_VERIFIED_SKILL_LABEL: string = 'Topcoder Verified'
88

99
export const EDIT_MODE_QUERY_PARAM: string = 'edit-mode'
1010

11+
export const TALENT_SEARCH_MODE_QUERY_PARAM: string = 'talent-search'
12+
1113
export enum profileEditModes {
1214
aboutMe = 'aboutMe',
1315
languages = 'languages',
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@import '@libs/ui/styles/includes';
2+
3+
.container {
4+
display: flex;
5+
flex-direction: column;
6+
7+
p {
8+
margin-bottom: $sp-4;
9+
}
10+
11+
ul {
12+
list-style: disc;
13+
margin: 0 0 $sp-2 $sp-4;
14+
15+
li {
16+
margin-bottom: $sp-4;
17+
}
18+
}
19+
20+
.checkIconRow {
21+
display: flex;
22+
23+
svg {
24+
margin: 0 $sp-2;
25+
width: 24px;
26+
height: 24px;
27+
color: $turq-120;
28+
}
29+
}
30+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { FC } from 'react'
2+
3+
import { BaseModal, IconOutline } from '~/libs/ui'
4+
5+
import styles from './HowSkillsWorkModal.module.scss'
6+
7+
interface HowSkillsWorkModalProps {
8+
onClose: () => void
9+
isTalentSearch?: boolean
10+
}
11+
12+
const HowSkillsWorkModal: FC<HowSkillsWorkModalProps> = (props: HowSkillsWorkModalProps) => (
13+
<BaseModal
14+
onClose={props.onClose}
15+
open
16+
title='How Skills Work?'
17+
size='lg'
18+
>
19+
{
20+
props.isTalentSearch ? (
21+
<div className={styles.container}>
22+
<p className='body-large-bold'>
23+
Topcoder Skill Matching
24+
</p>
25+
<p>Topcoder identifies experts that will best match the skills you are searching for.</p>
26+
<p className={styles.checkIconRow}>
27+
Look for the proven
28+
<IconOutline.CheckCircleIcon />
29+
next to skills.
30+
</p>
31+
<p>Here’s how it works:</p>
32+
<ul>
33+
<li>Experts perform specific Topcoder opportunities</li>
34+
<li>Each opportunity has associated skills (ex: javascript, HTML)</li>
35+
<li>
36+
Experts prove they are proficient in these skills
37+
by completing opportunities on the platform
38+
</li>
39+
<li>Topcoder tracks and labels these skills, displaying what skills have been proven</li>
40+
<li>The more opportunities our experts complete the higher they rate for associated skills</li>
41+
</ul>
42+
<p>
43+
Experts can also self-proclaim skills that have not yet been proven.
44+
These will display as skills without a checkmark.
45+
</p>
46+
</div>
47+
) : (
48+
<div className={styles.container}>
49+
<p className='body-large-bold'>
50+
Topcoder Proven Skills
51+
</p>
52+
<p>Our experts work hard to prove their skills through Topcoder opportunities.</p>
53+
<p className={styles.checkIconRow}>
54+
Look for the proven
55+
<IconOutline.CheckCircleIcon />
56+
next to skills.
57+
</p>
58+
<p>Here’s how it works:</p>
59+
<ul>
60+
<li>Experts perform specific Topcoder opportunities</li>
61+
<li>Each opportunity has associated skills (ex: javascript, HTML)</li>
62+
<li>
63+
Experts prove they are proficient in these skills
64+
by completing opportunities on the platform
65+
</li>
66+
<li>Topcoder tracks and labels these skills, displaying what skills have been proven</li>
67+
<li>The more opportunities our experts complete the higher they rate for associated skills</li>
68+
</ul>
69+
<p>
70+
Experts can also self-proclaim skills that have not yet been proven.
71+
These will display as skills without a checkmark.
72+
</p>
73+
</div>
74+
)
75+
}
76+
</BaseModal>
77+
)
78+
79+
export default HowSkillsWorkModal
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as HowSkillsWorkModal } from './HowSkillsWorkModal'

src/apps/profiles/src/member-profile/skills/MemberSkillsInfo.module.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,4 @@
5757
}
5858
}
5959
}
60-
61-
.legendWrap {
62-
display: flex;
63-
color: $link-blue-dark;
64-
65-
&:hover {
66-
text-decoration: underline;
67-
}
68-
}
6960
}

src/apps/profiles/src/member-profile/skills/MemberSkillsInfo.tsx

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { useSearchParams } from 'react-router-dom'
33
import classNames from 'classnames'
44

55
import { isVerifiedSkill, UserEMSISkill, UserProfile } from '~/libs/core'
6-
import { IconOutline } from '~/libs/ui'
6+
import { Button, IconOutline } from '~/libs/ui'
77

88
import { AddButton, EditMemberPropertyBtn, EmptySection } from '../../components'
9-
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
9+
import { EDIT_MODE_QUERY_PARAM, profileEditModes, TALENT_SEARCH_MODE_QUERY_PARAM } from '../../config'
1010

1111
import { ModifySkillsModal } from './ModifySkillsModal'
12+
import { HowSkillsWorkModal } from './HowSkillsWorkModal'
1213
import styles from './MemberSkillsInfo.module.scss'
1314

1415
interface MemberSkillsInfoProps {
@@ -20,6 +21,7 @@ interface MemberSkillsInfoProps {
2021
const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProps) => {
2122
const [queryParams]: [URLSearchParams, any] = useSearchParams()
2223
const editMode: string | null = queryParams.get(EDIT_MODE_QUERY_PARAM)
24+
const talentSearchQuery: string | null = queryParams.get(TALENT_SEARCH_MODE_QUERY_PARAM)
2325

2426
const canEdit: boolean = props.authProfile?.handle === props.profile.handle
2527

@@ -33,10 +35,20 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
3335
const [isEditMode, setIsEditMode]: [boolean, Dispatch<SetStateAction<boolean>>]
3436
= useState<boolean>(false)
3537

38+
const [howSkillsWorkVisible, setHowSkillsWorkVisible]: [boolean, Dispatch<SetStateAction<boolean>>]
39+
= useState<boolean>(false)
40+
41+
const [isTalentSearch, setIsTalentSearch]: [boolean, Dispatch<SetStateAction<boolean>>]
42+
= useState<boolean>(false)
43+
3644
useEffect(() => {
3745
if (props.authProfile && editMode === profileEditModes.skills) {
3846
setIsEditMode(true)
3947
}
48+
49+
if (talentSearchQuery === 'true') {
50+
setIsTalentSearch(true)
51+
}
4052
// eslint-disable-next-line react-hooks/exhaustive-deps
4153
}, [props.authProfile])
4254

@@ -55,6 +67,14 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
5567
}, 1500)
5668
}
5769

70+
function handleHowSkillsWorkClick(): void {
71+
setHowSkillsWorkVisible(true)
72+
}
73+
74+
function handleHowSkillsWorkClose(): void {
75+
setHowSkillsWorkVisible(false)
76+
}
77+
5878
return memberEMSISkills ? (
5979
<div className={styles.container}>
6080
<div className={styles.titleWrap}>
@@ -68,12 +88,12 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
6888
)
6989
}
7090
</div>
71-
<a
72-
className={styles.legendWrap}
73-
href='/'
74-
>
75-
How skills work?
76-
</a>
91+
<Button
92+
link
93+
label='How skills work?'
94+
onClick={handleHowSkillsWorkClick}
95+
variant='linkblue'
96+
/>
7797
</div>
7898

7999
<div className={styles.skillsWrap}>
@@ -117,6 +137,15 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
117137
/>
118138
)
119139
}
140+
141+
{
142+
howSkillsWorkVisible && (
143+
<HowSkillsWorkModal
144+
onClose={handleHowSkillsWorkClose}
145+
isTalentSearch={isTalentSearch}
146+
/>
147+
)
148+
}
120149
</div>
121150
) : <></>
122151
}

0 commit comments

Comments
 (0)