Skip to content
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

fix(moment): hide logbook icon on avatar of moment digest footer #4881

Merged
merged 1 commit into from
Oct 6, 2024
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
13 changes: 11 additions & 2 deletions src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface AvatarProps {
src?: string | null
inEditor?: boolean
inProfile?: boolean
showLogbook?: boolean
title?: string
}

Expand Down Expand Up @@ -68,14 +69,22 @@ const fragments = {
}

export const Avatar = (props: AvatarProps) => {
const { user, size = 40, src, title, inEditor, inProfile } = props
const {
user,
size = 40,
src,
title,
inEditor,
inProfile,
showLogbook = true,
} = props
const source = src || user?.avatar || ICON_AVATAR_DEFAULT
const isFallback =
(!src && !user?.avatar) || source.indexOf('data:image') >= 0
const isCivicLiker = user?.liker.civicLiker
const badges = user?.info?.badges || []
const hasArchitectBadge = badges.some((b) => b.type === 'architect')
const hasLogbook = !!user?.info?.cryptoWallet?.hasNFTs
const hasLogbook = showLogbook && !!user?.info?.cryptoWallet?.hasNFTs
const avatarClasses = classNames({
[styles.avatar]: true,
avatar: true, // global selector for overwirting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ const CommentedFollowees = ({ moment }: CommentedFolloweesProps) => {
<section className={styles.followees}>
{commentedFollowees.slice(0, 3).map((user) => (
<section className={styles.user} key={user.id}>
<UserDigest.Mini user={user} avatarSize={20} hasAvatar disabled />
<UserDigest.Mini
user={user}
avatarSize={20}
hasAvatar
disabled
showLogbook={false}
/>
</section>
))}
</section>
Expand Down
Loading