-
-
Notifications
You must be signed in to change notification settings - Fork 829
Migrate Avatar to new Compound component #11393
Conversation
/> | ||
); | ||
} | ||
return ( |
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.
Looks like onClick
is unused
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.
Thanks, not sure why ESLint was not shouting at me, back in use now.
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.
The rule is disabled on this block
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.
Unfortunately https://github.com/matrix-org/matrix-react-sdk/pull/11393/files#diff-f61169b723cd2eea456ca1c6fa8879aaf150f49060d77d4d8bf42257093e078fR114 applies to the whole block not just that one line
@@ -82,7 +82,7 @@ export default class RoomAvatarEvent extends React.Component<IProps> { | |||
className="mx_RoomAvatarEvent_avatar" | |||
onClick={this.onAvatarClick} | |||
> | |||
<RoomAvatar width={14} height={14} oobData={oobData} /> | |||
<RoomAvatar width={16} oobData={oobData} /> |
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.
Can this happen in a different PR?
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.
Not quite, the new avatar uses box-sizing: border-box
, so if i do not do that change the avatars end up being two pixels smaller.
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.
altText = _t("Avatar"), | ||
ariaLabel = _t("Avatar"), |
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.
Losing this seems bad, this is the aria-label for the button which wraps clickable avatars
Any chance of screenshots of more variants, with globe cutout, with online indicator cutout, user info (large), space home, etc etc |
aria-label={ariaLabel} | ||
aria-live="off" |
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.
Losing these seems bad
); | ||
const imgNode = ( | ||
<img | ||
loading="lazy" |
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.
Losing this seems bad
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.
Added to element-hq/compound-web#57
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.
Added to element-hq/compound-web#57
aria-hidden="true" | ||
data-testid="avatar-img" |
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.
Losing these seems bad
className={classNames("mx_BaseAvatar", className)} | ||
ref={inputRef} | ||
{...otherProps} | ||
role="presentation" |
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.
Losing this seems bad
/** | ||
* @deprecated use `width` only, avatars have a 1:1 aspect ratio | ||
*/ | ||
height: number; |
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.
Can we just kill it? We're not a real SDK so don't need backwards compatibility, confusion is worse than bigger diffs
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.
Done! I will rename width
to size
in a follow up PR
Supplemented by #11448. |
Uses https://compound.element.io/?path=/story/compound-web_avatar--round
Checklist
Here's what your changelog entry will look like:
✨ Features