Skip to content

Avatar component: switch to next/image and keep the fallback chain #52

Description

@geetxnshgoyal

Problem

components/ui/avatar.tsx:22 renders <img src={chain[0]}>. The component tries a list of sources in order (chain), dropping to the next on error. Because it's shared, fixing it here improves every page that uses <Avatar>.

Done when

  • It renders next/image's <Image>, with width/height taken from the component's size prop.
  • The fallback still works. Test by pointing a member at a GitHub username that doesn't exist: the next source (or the initials) must appear, not a broken image.
  • npx eslint components/ui/avatar.tsx shows no no-img-element.
  • npm run build passes.

Size: ~10–20 lines.


Taking this? Comment /assign and the bot assigns you if it's free. One issue per person at a time; comment /unassign to hand it back. That's milestone 2 of the 10 PR Journey. Setup, the checks CI runs, and how to open the PR from your fork are in CONTRIBUTING.md. Put Fixes #<this issue> in your PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions