Skip to content

Commit ce44c8e

Browse files
committed
MP-170 - show "empty" block content for profile when viewed publicly
1 parent 14afb1b commit ce44c8e

File tree

9 files changed

+75
-13
lines changed

9 files changed

+75
-13
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@import "@libs/ui/styles/includes";
2+
3+
.wrap {
4+
background: $black-10;
5+
border-radius: $sp-4;
6+
flex: 1 1;
7+
width: 100%;
8+
height: 100%;
9+
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
flex-direction: column;
14+
15+
text-align: center;
16+
17+
gap: $sp-8;
18+
padding: $sp-15 $sp-11;
19+
20+
&:global(.m-lg) {
21+
padding: $sp-15 2*$sp-15;
22+
}
23+
24+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { FC, PropsWithChildren } from 'react'
2+
import classNames from 'classnames'
3+
4+
import styles from './EmptySection.module.scss'
5+
6+
interface EmptySectionProps extends PropsWithChildren {
7+
title?: string
8+
wide?: boolean
9+
}
10+
11+
const EmptySection: FC<EmptySectionProps> = props => (
12+
<div className={classNames(styles.wrap, props.wide && 'm-lg')}>
13+
{props.title && (
14+
<div className='body-medium-bold'>{props.title}</div>
15+
)}
16+
{props.children}
17+
</div>
18+
)
19+
20+
export default EmptySection
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as EmptySection } from './EmptySection'

src/apps/profiles/src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './LogoDesignDetailsModal'
1515
export * from './WebDesignDetailsModal'
1616
export * from './DesignF2FDetailsModal'
1717
export * from './EditMemberPropertyBtn'
18+
export * from './EmptySection'

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { KeyedMutator } from 'swr'
55
import { useMemberTraits, UserProfile, UserTrait, UserTraitIds, UserTraits } from '~/libs/core'
66

77
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
8-
import { EditMemberPropertyBtn } from '../../components'
8+
import { EditMemberPropertyBtn, EmptySection } from '../../components'
99
import { MemberTCAInfo } from '../tca-info'
1010

1111
import { ModifyEducationModal } from './ModifyEducationModal'
@@ -71,14 +71,18 @@ const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props:
7171
</div>
7272

7373
<div className={styles.educationContentWrap}>
74-
{
75-
memberEducation?.map((education: UserTrait) => (
74+
{(memberEducation?.length as number) > 0
75+
? memberEducation?.map((education: UserTrait) => (
7676
<EducationCard
7777
key={`${education.schoolCollegeName}-${education.major}`}
7878
education={education}
7979
/>
8080
))
81-
}
81+
: (
82+
<EmptySection>
83+
I&apos;m still building up my education and certifications here at Topcoder.
84+
</EmptySection>
85+
)}
8286
</div>
8387

8488
<MemberTCAInfo profile={props.profile} />

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import classNames from 'classnames'
55
import { isVerifiedSkill, UserEMSISkill, UserProfile } from '~/libs/core'
66
import { IconOutline } from '~/libs/ui'
77

8-
import { EditMemberPropertyBtn } from '../../components'
8+
import { EditMemberPropertyBtn, EmptySection } from '../../components'
99
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
1010

1111
import { ModifySkillsModal } from './ModifySkillsModal'
@@ -68,8 +68,8 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
6868
</div>
6969

7070
<div className={styles.skillsWrap}>
71-
{
72-
memberEMSISkills.map((memberEMSISkill: UserEMSISkill) => (
71+
{memberEMSISkills?.length > 0
72+
? memberEMSISkills.map((memberEMSISkill: UserEMSISkill) => (
7373
<div
7474
className={classNames(
7575
styles.skillItem,
@@ -81,7 +81,15 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
8181
{isVerifiedSkill(memberEMSISkill.skillSources) && <IconOutline.CheckCircleIcon />}
8282
</div>
8383
))
84-
}
84+
: (
85+
<EmptySection
86+
title='Topcoder verifies and tracks skills as our members complete projects and challenges.'
87+
wide
88+
>
89+
This member has not yet provided skills, but check back soon as their skills will grow as
90+
they complete project tasks.
91+
</EmptySection>
92+
)}
8593
</div>
8694

8795
{

src/apps/profiles/src/member-profile/work-expirence/WorkExpirence.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
.contentWrap {
2323
display: flex;
2424
flex-direction: column;
25+
padding-bottom: $sp-4;
2526
}
2627
}

src/apps/profiles/src/member-profile/work-expirence/WorkExpirence.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { KeyedMutator } from 'swr'
55
import { useMemberTraits, UserProfile, UserTrait, UserTraitIds, UserTraits } from '~/libs/core'
66

77
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
8-
import { EditMemberPropertyBtn } from '../../components'
8+
import { EditMemberPropertyBtn, EmptySection } from '../../components'
99

1010
import { ModifyWorkExpirenceModal } from './ModifyWorkExpirenceModal'
1111
import { WorkExpirenceCard } from './WorkExpirenceCard'
@@ -70,11 +70,15 @@ const WorkExpirence: FC<WorkExpirenceProps> = (props: WorkExpirenceProps) => {
7070
</div>
7171

7272
<div className={styles.contentWrap}>
73-
{
74-
workExpirence?.map((work: UserTrait) => (
73+
{(workExpirence?.length as number) > 0
74+
? workExpirence?.map((work: UserTrait) => (
7575
<WorkExpirenceCard key={`${work.company}-${work.industry}-${work.position}`} work={work} />
7676
))
77-
}
77+
: (
78+
<EmptySection>
79+
I&apos;m still building up my experience here at Topcoder.
80+
</EmptySection>
81+
)}
7882
</div>
7983

8084
{

src/apps/profiles/src/member-profile/work-expirence/WorkExpirenceCard/WorkExpirenceCard.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import '@libs/ui/styles/includes';
22

33
.workExpirenceCard {
4-
margin-bottom: $sp-4;
54
flex: 1;
65

76
.workExpirenceCardHeader {

0 commit comments

Comments
 (0)