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

Feature/avatar component #129

Merged
merged 16 commits into from
Sep 28, 2023
Merged

Feature/avatar component #129

merged 16 commits into from
Sep 28, 2023

Conversation

Twonarly1
Copy link
Contributor

Description

Task link: https://trello.com/c/Fvz98TFA/216-avatar-component

Added Avatar component

Test Steps

  1. Ensure the component's structure, stories, and testing suite are robust.
  2. Confirm that all tests are successful.
  3. Check that the Avatar component displays correctly in both storybook and sample downstream applications.

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2023

🦋 Changeset detected

Latest commit: 81f884d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@animareflection/ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ui-storybook ✅ Ready (Inspect) Visit Preview Sep 28, 2023 2:50am
ui-studio ✅ Ready (Inspect) Visit Preview Sep 28, 2023 2:50am

@Twonarly1
Copy link
Contributor Author

Twonarly1 commented Sep 27, 2023

this seems redundant with the panda.div inside the fallback, but it was a struggle to get content aligned without doing this. If anyone cares to give it a go and see what they can do, please do!

 <AvatarFallback className={classNames.fallback}>
        <panda.div
          height="inherit"
          justifyContent="center"
          alignItems="center"
          display="flex"
        >
          {fallback}
        </panda.div>
      </AvatarFallback>
      ```

@hobbescodes
Copy link
Contributor

this seems redundant with the panda.div inside the fallback, but it was a struggle to get content aligned without doing this. If anyone cares to give it a go and see what they can do, please do!

 <AvatarFallback className={classNames.fallback}>
        <panda.div
          height="inherit"
          justifyContent="center"
          alignItems="center"
          display="flex"
        >
          {fallback}
        </panda.div>
      </AvatarFallback>
      ```

Close! Make sure that the closing dashes are on the same indent level as the opening, example:

 <AvatarFallback className={classNames.fallback}>
        <panda.div
          height="inherit"
          justifyContent="center"
          alignItems="center"
          display="flex"
        >
          {fallback}
        </panda.div>
  </AvatarFallback>

@hobbescodes
Copy link
Contributor

this seems redundant with the panda.div inside the fallback, but it was a struggle to get content aligned without doing this. If anyone cares to give it a go and see what they can do, please do!

 <AvatarFallback className={classNames.fallback}>
        <panda.div
          height="inherit"
          justifyContent="center"
          alignItems="center"
          display="flex"
        >
          {fallback}
        </panda.div>
      </AvatarFallback>
      ```

Will check it out in PR! Ty for the grind man. You are killing it

Comment on lines 67 to 68
// TODO remove explicit type annotation, required due to `pnpm` bug (and therefore Yarn with `pnpm` linker); https://github.com/microsoft/TypeScript/issues/47663
const meta: Meta<typeof Avatar> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove this now!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I saw my branch was behind again and caught that! Thanks for the heads up.

Comment on lines 15 to 19
{isLoaded ? (
<Avatar src="/img/logo.png" alt="avatar" />
) : (
<Avatar src="" alt="" />
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified to checking isLoaded in the props themselves, that way there wouldn't need to be 2 <Avatar ... lines

Comment on lines 14 to 17
<Avatar src="/img/logo.png" alt="avatar" />
) : (
<Avatar src="" alt="" />
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comment (can reduce Avatar lines)

Comment on lines 16 to 20
{isLoaded ? (
<Avatar src="/img/logo.png" alt="avatar" />
) : (
<Avatar src="" />
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comment

Copy link
Contributor

@coopbri coopbri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently unable to see the fallback avatar content on dark mode:

2023-09-27_20-53

@Twonarly1
Copy link
Contributor Author

Had some inspiration with the text being offset in the fallback and added a margin to counterbalance the borderWidth which was affecting it.

@Twonarly1 Twonarly1 merged commit 95be098 into master Sep 28, 2023
@Twonarly1 Twonarly1 deleted the feature/avatar-component branch September 28, 2023 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants