-
Notifications
You must be signed in to change notification settings - Fork 21
PM-3456 Add tooltip and fix mobile view #1431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => { | |
| const showMyStatusLabel = canEdit | ||
| const showAdminLabel = isPrivilegedViewer | ||
|
|
||
| return ( | ||
| const content = ( | ||
| <div className={styles.profileActions}> | ||
| {showMyStatusLabel && <span>My status:</span>} | ||
|
|
||
|
|
@@ -133,6 +133,17 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => { | |
| /> | ||
| </div> | ||
| ) | ||
|
|
||
| return canEdit ? ( | ||
| <Tooltip | ||
| content='This information is visible to you only' | ||
| place='top' | ||
| > | ||
| {content} | ||
| </Tooltip> | ||
| ) : ( | ||
| content | ||
| ) | ||
| } | ||
|
|
||
| function renderActivityStatus(): JSX.Element { | ||
|
|
@@ -222,15 +233,17 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => { | |
| </p> | ||
| </div> | ||
| </div> | ||
| { | ||
| canSeeActivityBadge ? renderActivityStatus() : undefined | ||
| } | ||
| <div className={styles.statusRow}> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| { | ||
| canSeeActivityBadge ? renderActivityStatus() : undefined | ||
| } | ||
|
|
||
| { | ||
| { | ||
| // Showing only when they can edit until we have the talent search app | ||
| // and enough data to make this useful | ||
| canEdit || isPrivilegedViewer ? renderOpenForWork() : undefined | ||
| } | ||
| canEdit || isPrivilegedViewer ? renderOpenForWork() : undefined | ||
| } | ||
| </div> | ||
|
|
||
| { | ||
| isMobile ? renderMemberPhotoWrap() : undefined | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[⚠️
maintainability]The conditional rendering of the
Tooltipcomponent based oncanEditis correct, but consider extracting this logic into a separate function for better maintainability and readability. This will make it easier to test and modify in the future.