Skip to content

Conversation

SHAZAM28
Copy link
Contributor

Description

Original issue: https://github.com/shop/issues-checkout/issues/5645

Create and add Avatar Component to Documentation

What's Changed

This PR introduces a new Avatar component for the Customer Account surface, making it easier for developers to display user profile images in their UI extensions.

📝 Changes Made Added Avatar component with TypeScript definitions and proper integration into the component system

  • Created comprehensive documentation including usage examples and API reference
  • Added working examples for both JavaScript and Preact frameworks
  • Updated documentation paths to ensure all references are correct and consistent

📚 Documentation Updates

  • Added detailed Avatar component documentation with usage guidelines
  • Included practical examples showing how to implement the Avatar component
  • Provided both JavaScript and Preact code samples for developer flexibility
  • Ensured all documentation paths and references are properly configured

Screenshot of working document:

Screenshot 2025-06-23 at 9 13 18 AM Screenshot 2025-06-23 at 9 15 35 AM

language: 'tsx',
},
{
title: 'JS',
Copy link
Member

@robin-drexler robin-drexler Jun 23, 2025

Choose a reason for hiding this comment

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

Don't we only do Preact examples now? Can we remove the JS one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like the JS examples still exist for the other components but are just not displayed on the documentation. I decided to follow that and keep the file but remove it from the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for not catching these all at once - but I still see the JS example on the docs. I think you need to remove the reference to it from this file

*
* @default 'base'
*/
size?: Extract<Size, 'base' | 'large' | 'extraLarge' | 'fill'>;
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that the size prop does not have as much information in the RC docs as it does in the previous version. Left is old right is new:

Screenshot 2025-06-23 at 3 01 38 PM

I am not 100% sure what the fix is here because you have the right content here. Maybe we need to import the Size prop in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I managed to fix this and it should now be working.

Here is a screenshot of the resolved issue:
Screenshot 2025-06-24 at 2 21 02 PM

Feel free to test it out yourself, and please let me know if any other adjustments need to be made 🙂

Copy link
Contributor

@andrewmcgov andrewmcgov Jun 24, 2025

Choose a reason for hiding this comment

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

Nice! I think you might have forgotten to push the change for this PR 😅 I dont see any changes since the last review on here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops sorry, I only pushed the shopify-dev commit, the ui-extensions one should be up to date now 🙂

Comment on lines 99 to 105
export type Size =
| 'extraSmall'
| 'small'
| 'base'
| 'large'
| 'extraLarge'
| 'fill';
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried it out, and I think you should be able to import this from the shared file instead at the top of the file:

import {Size} from './components/shared';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright I'll try again and see if that works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, change have been pushed

@SHAZAM28 SHAZAM28 force-pushed the add-avatar-2025rc branch from 0400758 to 797c859 Compare June 27, 2025 14:46
@SHAZAM28 SHAZAM28 merged commit b18c0d9 into 2025-10-rc Jun 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants