-
Notifications
You must be signed in to change notification settings - Fork 616
Refactor Avatar to use Box #2019
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
Conversation
|
size-limit report 📦
|
export function CustomSize(): JSX.Element { | ||
return <Avatar size={48} alt="Primer logo" src="https://avatars.githubusercontent.com/primer" /> | ||
} | ||
|
||
export function SquareAvatar(): JSX.Element { | ||
return <Avatar square alt="Primer logo" src="https://avatars.githubusercontent.com/primer" /> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could just be Storybook controls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! I'm creating extra stories so that they can be part of our visual regression testing suite :)
Should I also add a story with all the controls? (.langermank calls it the playground story in primer-css)
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days. |
noooooo! |
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days. |
@@ -12,33 +11,31 @@ type StyledAvatarProps = { | |||
src: string | |||
/** Provide alt text when the Avatar is used without the user's name next to it. */ | |||
alt?: string | |||
} & SxProp | |||
} & SxProp & | |||
Omit<React.ComponentProps<'img'>, 'ref'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use ComponentPropsWithoutRef
here
Omit<React.ComponentProps<'img'>, 'ref'> | |
React.ComponentPropsWithoutRef<'img'> |
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days. |
Refactor Avatar to use Box + sx as recommended in #2020