Skip to content

Commit eb8435c

Browse files
committed
MP-29 skills picker
1 parent 71cbc44 commit eb8435c

File tree

6 files changed

+67
-9
lines changed

6 files changed

+67
-9
lines changed

src/apps/profiles/src/member-profile/page-layout/ProfilePageLayout.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
height: 100%;
88

99
.profileHeaderWrap {
10-
background: url('../../lib/assets/profile-header-bg.png') no-repeat right center / auto, linear-gradient(#0d83c5, #0e89d5);
10+
background: url('../../lib/assets/profile-header-bg.png') no-repeat right top / auto, linear-gradient(#0d83c5, #0e89d5);
1111

1212
.profileHeaderContent {
1313
padding: 0;
14-
max-height: 200px;
14+
max-height: 260px;
1515
overflow: visible;
1616

1717
@include ltelg {
@@ -57,7 +57,7 @@
5757
.profileInfoRight {
5858
display: flex;
5959
flex-direction: column;
60-
margin-top: -215px;
60+
margin-top: -275px;
6161

6262
@include ltelg {
6363
margin-top: 0;

src/apps/profiles/src/member-profile/page-layout/ProfilePageLayout.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ const ProfilePageLayout: FC<ProfilePageLayoutProps> = (props: ProfilePageLayoutP
8080

8181
<div className={styles.sectionWrap}>
8282
<div className={styles.skillsWrap}>
83-
<MemberSkillsInfo profile={props.profile} authProfile={props.authProfile} />
83+
<MemberSkillsInfo
84+
profile={props.profile}
85+
authProfile={props.authProfile}
86+
refreshProfile={props.refreshProfile}
87+
/>
8488
</div>
8589
</div>
8690

src/apps/profiles/src/member-profile/profile-header/ProfileHeader.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
.photoWrap {
1111
position: relative;
12-
margin-right: $sp-13;
12+
margin-right: 60px;
1313

1414
.verifiedBadge {
1515
position: absolute;

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import styles from './MemberSkillsInfo.module.scss'
1414
interface MemberSkillsInfoProps {
1515
profile: UserProfile
1616
authProfile: UserProfile | undefined
17+
refreshProfile: (handle: string) => void
1718
}
1819

1920
const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProps) => {
@@ -47,6 +48,13 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
4748
setIsEditMode(false)
4849
}
4950

51+
function handleModyfSkillsSave(): void {
52+
setTimeout(() => {
53+
setIsEditMode(false)
54+
props.refreshProfile(props.profile.handle)
55+
}, 1500)
56+
}
57+
5058
return memberEMSISkills ? (
5159
<div className={styles.container}>
5260
<div className={styles.titleWrap}>
@@ -98,8 +106,8 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
98106
{
99107
isEditMode && (
100108
<ModifySkillsModal
101-
// profile={props.profile}
102109
onClose={handleModyfSkillsModalClose}
110+
onSave={handleModyfSkillsSave}
103111
/>
104112
)
105113
}

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,29 @@
33
.container {
44
display: flex;
55
flex-direction: column;
6+
7+
:global(.body-main-bold) {
8+
font-size: 20px;
9+
margin-bottom: $sp-2;
10+
}
11+
12+
.skillPicker {
13+
margin-top: $sp-4;
14+
}
615
}
716

817
.modalButtons {
918
display: flex;
1019
justify-content: space-between;
1120
width: 100%;
1221
}
22+
23+
.skillsModal {
24+
@include gtemd {
25+
overflow: visible !important;
26+
}
27+
}
28+
29+
.skillsModalBody {
30+
overflow: visible !important;
31+
}

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

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
import { Dispatch, FC, SetStateAction, useState } from 'react'
2+
import { toast } from 'react-toastify'
23

3-
// import { UserProfile } from '~/libs/core'
44
import { BaseModal, Button } from '~/libs/ui'
5+
import { MemberSkillEditor, useMemberSkillEditor } from '~/libs/shared'
56

67
import styles from './ModifySkillsModal.module.scss'
78

89
interface ModifySkillsModalProps {
9-
// profile: UserProfile
1010
onClose: () => void
11+
onSave: () => void
1112
}
1213

1314
const ModifySkillsModal: FC<ModifySkillsModalProps> = (props: ModifySkillsModalProps) => {
1415
const [isSaving, setIsSaving]: [boolean, Dispatch<SetStateAction<boolean>>]
1516
= useState<boolean>(false)
1617

18+
const { formInput: emsiFormInput, saveSkills: saveEmsiSkills }: MemberSkillEditor = useMemberSkillEditor()
19+
1720
function handleModifySkillsSave(): void {
1821
setIsSaving(true)
22+
23+
saveEmsiSkills()
24+
.then(() => {
25+
toast.success('Skills updated successfully.', { position: toast.POSITION.BOTTOM_RIGHT })
26+
props.onSave()
27+
})
28+
.catch(() => {
29+
toast.error('Failed to update your skills.', { position: toast.POSITION.BOTTOM_RIGHT })
30+
setIsSaving(false)
31+
})
1932
}
2033

2134
return (
2235
<BaseModal
36+
bodyClassName={styles.skillsModalBody}
37+
classNames={{
38+
modal: styles.skillsModal,
39+
}}
2340
onClose={props.onClose}
2441
open
2542
size='lg'
@@ -39,7 +56,17 @@ const ModifySkillsModal: FC<ModifySkillsModalProps> = (props: ModifySkillsModalP
3956
/>
4057
</div>
4158
)}
42-
/>
59+
>
60+
<div className={styles.container}>
61+
<p className='body-main-bold'>What are your skills?</p>
62+
<p>
63+
Understanding your skills will allow us to connect you to the right opportunities.
64+
</p>
65+
<div className={styles.skillPicker}>
66+
{emsiFormInput}
67+
</div>
68+
</div>
69+
</BaseModal>
4370
)
4471
}
4572

0 commit comments

Comments
 (0)