mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Merge pull request #5037 from matrix-org/t3chguy/room-list/14705
Fix BaseAvatar wrongly using Buttons when it needs not
This commit is contained in:
commit
ff8f1af01e
2 changed files with 5 additions and 6 deletions
|
@ -134,7 +134,7 @@ const BaseAvatar = (props: IProps) => {
|
|||
aria-hidden="true" />
|
||||
);
|
||||
|
||||
if (onClick !== null) {
|
||||
if (onClick) {
|
||||
return (
|
||||
<AccessibleButton
|
||||
{...otherProps}
|
||||
|
@ -162,7 +162,7 @@ const BaseAvatar = (props: IProps) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (onClick !== null) {
|
||||
if (onClick) {
|
||||
return (
|
||||
<AccessibleButton
|
||||
className={classNames("mx_BaseAvatar mx_BaseAvatar_image", className)}
|
||||
|
@ -196,4 +196,4 @@ const BaseAvatar = (props: IProps) => {
|
|||
};
|
||||
|
||||
export default BaseAvatar;
|
||||
export type BaseAvatarType = React.FC<IProps>;
|
||||
export type BaseAvatarType = React.FC<IProps>;
|
||||
|
|
|
@ -205,9 +205,8 @@ describe("<TextualBody />", () => {
|
|||
expect(content.html()).toBe('<span class="mx_EventTile_body markdown-body" dir="auto">' +
|
||||
'Hey <span>' +
|
||||
'<a class="mx_Pill mx_UserPill" title="@user:server">' +
|
||||
'<img src="mxc://avatar.url/image.png" style="width: 16px; height: 16px;" ' +
|
||||
'title="@member:domain.bla" alt="" aria-hidden="true" role="button" tabindex="0" ' +
|
||||
'class="mx_AccessibleButton mx_BaseAvatar mx_BaseAvatar_image">Member</a>' +
|
||||
'<img class="mx_BaseAvatar mx_BaseAvatar_image" src="mxc://avatar.url/image.png" ' +
|
||||
'style="width: 16px; height: 16px;" title="@member:domain.bla" alt="" aria-hidden="true">Member</a>' +
|
||||
'</span></span>');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue