Revert "use <img> instead of <div> for avatars"
This reverts commit a34b7d3b5e
.
This commit is contained in:
parent
da5dc4c66a
commit
e8ba29f835
|
@ -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}
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
|
|
Reference in New Issue