-
Notifications
You must be signed in to change notification settings - Fork 23
feat(PM-3454): Added identity verified badge to profiles page #1416
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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| @import "@libs/ui/styles/includes"; | ||
|
|
||
| .badgeContainer { | ||
|
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. [💡 |
||
| position: absolute; | ||
| top: 0px; | ||
| right: 20px; | ||
| z-index: 10; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .badge { | ||
| position: relative; | ||
| width: 68px; | ||
| height: 68px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| @include ltelg { | ||
| width: 56px; | ||
| height: 56px; | ||
| } | ||
|
|
||
| .icon { | ||
| width: 100%; | ||
| height: 100%; | ||
| filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)); | ||
| } | ||
| } | ||
|
|
||
| .tooltip { | ||
|
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. [ |
||
| position: absolute; | ||
| bottom: calc(100% + 8px); | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| background-color: $black-100; | ||
|
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. [ |
||
| color: $tc-white; | ||
| padding: $sp-1 $sp-2; | ||
| border-radius: 4px; | ||
| font-size: 12px; | ||
| white-space: nowrap; | ||
| opacity: 0; | ||
| pointer-events: none; | ||
| transition: opacity 0.2s ease-in-out; | ||
| z-index: 20; | ||
|
|
||
| &::after { | ||
| content: ''; | ||
| position: absolute; | ||
| top: 100%; | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| border: 6px solid transparent; | ||
| border-top-color: $black-100; | ||
| } | ||
| } | ||
|
|
||
| .badgeContainer:hover .tooltip { | ||
| opacity: 1; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { FC } from 'react' | ||
|
|
||
| import { IdentityVerifiedBadgeIcon } from '~/libs/ui' | ||
|
|
||
| import styles from './IdentityVerifiedBadge.module.scss' | ||
|
|
||
| interface IdentityVerifiedBadgeProps { | ||
| identityVerified?: boolean | ||
|
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. [ |
||
| } | ||
|
|
||
| const IdentityVerifiedBadge: FC<IdentityVerifiedBadgeProps> = (props: IdentityVerifiedBadgeProps) => { | ||
| if (!props.identityVerified) { | ||
| // eslint-disable-next-line unicorn/no-null | ||
|
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. [💡
Collaborator
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. FYI, this is good suggestion and practice to appy going forward @hentrymartin . |
||
| return null | ||
| } | ||
|
|
||
| return ( | ||
| <div className={styles.badgeContainer}> | ||
| <div className={styles.badge}> | ||
| <IdentityVerifiedBadgeIcon /> | ||
| </div> | ||
| <span className={styles.tooltip}>Identity Verified</span> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default IdentityVerifiedBadge | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import IdentityVerifiedBadge from './IdentityVerifiedBadge' | ||
|
|
||
| export { IdentityVerifiedBadge } | ||
| export default IdentityVerifiedBadge |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { OpenForGigs } from './OpenForGigs' | |
| import { ModifyMemberNameModal } from './ModifyMemberNameModal' | ||
| import { ModifyMemberPhotoModal } from './ModifyMemberPhotoModal' | ||
| import { HiringFormModal } from './HiringFormModal' | ||
| import IdentityVerifiedBadge from './IdentityVerifiedBadge' | ||
| import styles from './ProfileHeader.module.scss' | ||
|
|
||
| interface ProfileHeaderProps { | ||
|
|
@@ -109,6 +110,7 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => { | |
| return ( | ||
| <div className={styles.photoWrap}> | ||
| <ProfilePicture member={props.profile} className={styles.profilePhoto} /> | ||
| <IdentityVerifiedBadge identityVerified={props.profile.identityVerified} /> | ||
|
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. [ |
||
| {canEdit && hasProfilePicture && ( | ||
| <EditMemberPropertyBtn | ||
| className={styles.button} | ||
|
|
||
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.
[⚠️
design]The change from a ternary operator to a logical AND operator removes the
EmptySectioncomponent when there are no phones. Ensure that this behavior is intentional and that the user experience is not negatively impacted by the absence of a message indicating no phone numbers are available.