Skip to content

Commit 16f20af

Browse files
authored
Merge pull request #695 from topcoder-platform/profiles-app
Profiles app -> dev
2 parents cc9c7e8 + 70d1846 commit 16f20af

34 files changed

+864
-105
lines changed

src/apps/profiles/src/member-profile/community-awards/CommunityAwards.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
flex-direction: column;
66
margin-bottom: $sp-8;
77

8-
@include ltelg {
9-
padding: $sp-4;
10-
}
11-
128
.title {
139
display: flex;
1410
justify-content: space-between;

src/apps/profiles/src/member-profile/education-and-certifications/EducationAndCertifications.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99
align-items: center;
1010
margin-bottom: $sp-4;
1111
}
12+
13+
.educationContentWrap {
14+
display: flex;
15+
flex-direction: column;
16+
}
1217
}

src/apps/profiles/src/member-profile/education-and-certifications/EducationAndCertifications.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { EditMemberPropertyBtn } from '../../components'
99
import { MemberTCAInfo } from '../tca-info'
1010

1111
import { ModifyEducationModal } from './ModifyEducationModal'
12+
import { EducationCard } from './EducationCard'
1213
import styles from './EducationAndCertifications.module.scss'
1314

1415
interface EducationAndCertificationsProps {
@@ -31,7 +32,7 @@ const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props:
3132
}
3233
= useMemberTraits(props.profile.handle, { traitIds: UserTraitIds.education })
3334

34-
const education: UserTrait[] | undefined
35+
const memberEducation: UserTrait[] | undefined
3536
= useMemo(() => memberEducationTraits?.[0]?.traits?.data, [memberEducationTraits])
3637

3738
useEffect(() => {
@@ -50,7 +51,10 @@ const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props:
5051
}
5152

5253
function handleEditEducationModalSave(): void {
53-
mutateTraits()
54+
setTimeout(() => {
55+
setIsEditMode(false)
56+
mutateTraits()
57+
}, 1000)
5458
}
5559

5660
return (
@@ -66,16 +70,26 @@ const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props:
6670
}
6771
</div>
6872

73+
<div className={styles.educationContentWrap}>
74+
{
75+
memberEducation?.map((education: UserTrait) => (
76+
<EducationCard
77+
key={`${education.schoolCollegeName}-${education.major}`}
78+
education={education}
79+
/>
80+
))
81+
}
82+
</div>
83+
6984
<MemberTCAInfo profile={props.profile} />
7085

7186
{
7287
isEditMode && (
7388
<ModifyEducationModal
74-
// profile={props.profile}
75-
// authProfile={props.authProfile}
89+
profile={props.profile}
7690
onClose={handleEditEducationModalClose}
7791
onSave={handleEditEducationModalSave}
78-
education={education}
92+
education={memberEducation}
7993
/>
8094
)
8195
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@import '@libs/ui/styles/includes';
2+
3+
.educationCard {
4+
margin-bottom: $sp-4;
5+
flex: 1;
6+
7+
.educationCardHeader {
8+
display: flex;
9+
justify-content: space-between;
10+
align-items: flex-end;
11+
}
12+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { FC } from 'react'
2+
import moment from 'moment'
3+
4+
import { UserTrait } from '~/libs/core'
5+
6+
import styles from './EducationCard.module.scss'
7+
8+
interface EducationCardProps {
9+
education: UserTrait
10+
}
11+
12+
const EducationCard: FC<EducationCardProps> = (props: EducationCardProps) => (
13+
<div className={styles.educationCard}>
14+
<div className={styles.educationCardHeader}>
15+
<div className={styles.educationCardHeaderLeft}>
16+
<p className='body-main-bold'>
17+
{props.education.major}
18+
</p>
19+
<p>
20+
{props.education.schoolCollegeName}
21+
</p>
22+
</div>
23+
{
24+
props.education.timePeriodFrom || props.education.timePeriodTo ? (
25+
<div className={styles.educationCardHeaderRight}>
26+
<p>
27+
{props.education.timePeriodFrom ? moment(props.education.timePeriodFrom)
28+
.format('MM/YYYY') : ''}
29+
{' '}
30+
-
31+
{' '}
32+
{props.education.timePeriodTo ? moment(props.education.timePeriodTo)
33+
.format('MM/YYYY') : (props.education.graduated ? 'Graduated' : '')}
34+
</p>
35+
</div>
36+
) : undefined
37+
}
38+
</div>
39+
</div>
40+
)
41+
42+
export default EducationCard
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as EducationCard } from './EducationCard'

src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.module.scss

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,89 @@
33
.container {
44
display: flex;
55
flex-direction: column;
6+
7+
.educationWrap {
8+
margin-bottom: $sp-8;
9+
10+
&.noItems {
11+
margin-bottom: 0;
12+
}
13+
14+
.educationCardWrap {
15+
display: flex;
16+
align-items: center;
17+
18+
.actionElements {
19+
display: flex;
20+
align-items: center;
21+
margin-left: $sp-15;
22+
23+
:global(button) {
24+
padding: $sp-2;
25+
26+
@include ltelg {
27+
padding: $sp-1;
28+
}
29+
}
30+
31+
svg {
32+
width: 20px;
33+
height: 20px;
34+
}
35+
}
36+
}
37+
}
38+
39+
.row {
40+
display: flex;
41+
align-items: center;
42+
flex-wrap: wrap;
43+
44+
:global(.input-wrapper) {
45+
flex: 1;
46+
47+
@include ltelg {
48+
min-width: 100%;
49+
}
50+
51+
&:first-child {
52+
margin-right: $sp-2;
53+
54+
@include ltelg {
55+
margin-right: 0;
56+
}
57+
}
58+
}
59+
}
60+
61+
.formWrap {
62+
margin-top: $sp-4;
63+
64+
@include ltelg {
65+
:global(.input-wrapper) {
66+
margin-bottom: $sp-2;
67+
}
68+
}
69+
70+
.formCTAs {
71+
display: flex;
72+
align-items: center;
73+
74+
svg {
75+
width: 14px;
76+
height: 14px;
77+
margin-right: $sp-1;
78+
}
79+
80+
.ctaBtnCancel {
81+
margin-left: $sp-8;
82+
}
83+
}
84+
}
685
}
786

887
.modalButtons {
988
display: flex;
1089
justify-content: space-between;
1190
width: 100%;
12-
}
91+
}

0 commit comments

Comments
 (0)