diff --git a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js b/app/soapbox/features/profile_hover_card/profile_hover_card_container.js index e7e5c4f8c..c74137f49 100644 --- a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js +++ b/app/soapbox/features/profile_hover_card/profile_hover_card_container.js @@ -38,28 +38,37 @@ class ProfileHoverCardContainer extends ImmutablePureComponent { visible: true, } + getBadges = () => { + const { account } = this.props; + let badges = []; + if (isAdmin(account)) badges.push(); + if (isModerator(account)) badges.push(); + if (account.getIn(['patron', 'is_patron'])) badges.push(); + return badges; + } + render() { const { visible, accountId, account } = this.props; if (!accountId) return null; const accountBio = { __html: account.get('note_emojified') }; - let followed_by = account.getIn(['relationship', 'followed_by']); + const followedBy = account.getIn(['relationship', 'followed_by']); + const badges = this.getBadges(); return (
- { followed_by ? + {followedBy && - - : '' } + }
-
- {isAdmin(account) && } - {isModerator(account) && } - {account.getIn(['patron', 'is_patron']) && } -
-
+ {badges.length > 0 && +
+ {badges} +
} + {account.getIn(['source', 'note'], '').length > 0 && +
}
); diff --git a/app/styles/components/profile_hover_card.scss b/app/styles/components/profile_hover_card.scss index ebd924fa6..0910061cb 100644 --- a/app/styles/components/profile_hover_card.scss +++ b/app/styles/components/profile_hover_card.scss @@ -14,7 +14,7 @@ transition-property: opacity; transition-duration: 0.2s; transition-delay: 0.7s; - width: 265px; + width: 300px; z-index: 998; left: -10px; padding-top: 20px; @@ -73,6 +73,18 @@ .profile-hover-card__bio { margin: 0 20px 20px; + max-height: 4em; + + &::after { + content: ''; + display: block; + position: absolute; + width: 100%; + height: 20px; + bottom: 0; + left: 0; + background: linear-gradient(0deg, var(--foreground-color) 0%, var(--foreground-color), 80%, transparent); + } } }