ONEARMY / community-platform

A platform to build useful communities that aim to tackle global problems
https://platform.onearmy.earth
MIT License
1.14k stars 386 forks source link

Default avatar comment section #3677

Closed prashik0202 closed 2 months ago

prashik0202 commented 3 months ago

PR Checklist

PR Type

Description

What this PR does In comment section users with no profile picture has no avatar displayed on it. So we have rendered a default avatar image using conditional rendering.

Git Issues

Closes #3654

Screenshots/Videos

If useful, provide screenshot or capture to highlight main changes image


What happens next?

Thanks for the contribution! We try to make sure all PRs are reviewed ahead of our monthly maintainers call (first Monday of the month)

If the PR is working as intended it'll be merged and included in the next platform release, if not changes will be requested and re-reviewed once updated.

If you need more immediate feedback you can try reaching out on Discord in the Community Platform development channel.

github-actions[bot] commented 3 months ago

Visit the preview URL for this PR (updated for commit 74ce03e):

https://onearmy-next--pr3677-default-avatar-comme-61rx7mdw.web.app

(expires Fri, 26 Jul 2024 09:19:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59

mariojsnunes commented 3 months ago

there is this linting error in case you didn't see

/home/circleci/project/packages/components/src/CommentItem/CommentItem.tsx 1:1 error Run autofix to sort these imports! simple-import-sort/imports

mariojsnunes commented 3 months ago

you probably need to run yarn install locally, and then format the file

benfurber commented 3 months ago

Thanks for picking this up @prashik0202. Keeping the showAvatar variable at the level of displaying anything is important to keep because currently, avatars are only shown to beta-testers. (Part of @mariojsnunes's suggestion WAS WRONG (sorry about that))

I.e. When logged out, no avatar (for the moment):

Screenshot 2024-06-20 at 14 29 32

When logged in, avatar:

Screenshot 2024-06-20 at 14 30 03
prashik0202 commented 3 months ago

till now i have figured out that

simply using

<Avatar
    src={creatorImage ? creatorImage : defaultProfileImage}
    sx={{
      objectFit: 'cover',
      width: ['30px', '50px'],
      height: ['30px', '50px'],
    }}
/>

both in User and Beta-Tester it shows user profile but using showAvatar prop user profile are not visible suggest me on this

image

benfurber commented 3 months ago

@prashik0202 I think what you're saying to what I'm looking for. 👍

prashik0202 commented 3 months ago

@mariojsnunes i'm facing issue with showAvatar both in User and Beta Version.

benfurber commented 3 months ago

Thanks for picking this up @prashik0202. Keeping the showAvatar variable at the level of displaying anything is important to keep because currently, avatars are only shown to beta-testers.

showAvatar is needed and should be used, that's why the tests are failing - they're doing exactly what they should be doing.