Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ const ProfilePageLayout: FC<ProfilePageLayoutProps> = (props: ProfilePageLayoutP
</div>
<div className={styles.profileInfoRight}>
{canSeeProfileCompleteness && (
<ProfileCompleteness profile={props.profile} authProfile={props.authProfile} />
<ProfileCompleteness
profile={props.profile}
authProfile={props.authProfile}
isAdminOrTM={isAdminOrTM}
/>
)}
<div className={styles.sectionWrap}>
<div className={styles.skillsWrap}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import styles from './ProfileCompleteness.module.scss'
interface ProfileCompletenessProps {
profile: UserProfile
authProfile: UserProfile | undefined
isAdminOrTM?: boolean
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Changing isAdminOrTM from a required to an optional prop could lead to potential issues if the component logic assumes it is always defined. Ensure that the component handles the case where isAdminOrTM is undefined appropriately, especially in conditional rendering.

}

const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
Expand Down Expand Up @@ -42,19 +43,32 @@ const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
<div className={styles.wrap}>
<strong>Profile: </strong>
{`${completed}% Complete`}
<div>
<small>
Only
{' '}
{incompleteEntries}
{' '}
left to fill. Please add
{' '}
{count === 1 ? 'it' : 'them'}
{' '}
to make your profile more discoverable.
</small>
</div>
{!props.isAdminOrTM
&& (
<div>
<small>
Only
{' '}
{incompleteEntries}
{' '}
left to fill. Please add
{' '}
{count === 1 ? 'it' : 'them'}
{' '}
to make your profile more discoverable.
</small>
</div>
)}
{props.isAdminOrTM
&& (
<div>
<small>
{incompleteEntries}
{' '}
left to fill by the member.
</small>
</div>
)}
</div>
)
}
Expand Down
Loading