Revert "use <img> instead of <div> for avatars"

This reverts commit a34b7d3b5e.
This commit is contained in:
Kay Faraday 2022-07-02 20:51:00 +00:00
parent da5dc4c66a
commit e8ba29f835
3 changed files with 11 additions and 11 deletions

View File

@ -57,14 +57,14 @@ export default class Avatar extends React.PureComponent {
backgroundSize: `${size}px ${size}px`,
};
let imageSrc = staticSrc;
if (hovering || animate) {
imageSrc = src;
style.backgroundImage = `url(${src})`;
} else {
style.backgroundImage = `url(${staticSrc})`;
}
return (
<img
src={imageSrc}
<div
className={computedClass}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}

View File

@ -67,8 +67,6 @@ export default class AvatarComposite extends React.PureComponent {
}
}
const imageSrc = account.get(animate ? 'avatar' : 'avatar_static');
const style = {
left: left,
top: top,
@ -76,6 +74,8 @@ export default class AvatarComposite extends React.PureComponent {
bottom: bottom,
width: `${width}%`,
height: `${height}%`,
backgroundSize: 'cover',
backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,
};
return (
@ -86,7 +86,7 @@ export default class AvatarComposite extends React.PureComponent {
title={`@${account.get('acct')}`}
key={account.get('id')}
>
<img src={imageSrc} style={style} data-avatar-of={`@${account.get('acct')}`} />
<div style={style} data-avatar-of={`@${account.get('acct')}`} />
</a>
);
}

View File

@ -53,14 +53,14 @@ export default class Avatar extends React.PureComponent {
backgroundSize: `${size}px ${size}px`,
};
let imageSrc = staticSrc;
if (hovering || animate) {
imageSrc = src;
style.backgroundImage = `url(${src})`;
} else {
style.backgroundImage = `url(${staticSrc})`;
}
return (
<img
src={imageSrc}
<div
className={className}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}