diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2023-04-03 14:44:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 14:44:43 +0200 |
commit | 4909c2e7183f38caedd4445928033dc208762609 (patch) | |
tree | d0dc7a051f75c94db4c8cef124289d4cf96c9019 /app/javascript/mastodon/components/avatar.tsx | |
parent | 373e4a8ff034f189597cfbf651450b906eb598b1 (diff) |
New Crowdin updates (#24276)
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
Diffstat (limited to 'app/javascript/mastodon/components/avatar.tsx')
-rw-r--r-- | app/javascript/mastodon/components/avatar.tsx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/app/javascript/mastodon/components/avatar.tsx b/app/javascript/mastodon/components/avatar.tsx index 54ac611e6..e64a8af74 100644 --- a/app/javascript/mastodon/components/avatar.tsx +++ b/app/javascript/mastodon/components/avatar.tsx @@ -10,7 +10,7 @@ type Props = { style?: React.CSSProperties; inline?: boolean; animate?: boolean; -} +}; export const Avatar: React.FC<Props> = ({ account, @@ -19,7 +19,6 @@ export const Avatar: React.FC<Props> = ({ inline = false, style: styleFromParent, }) => { - const { hovering, handleMouseEnter, handleMouseLeave } = useHovering(animate); const style = { @@ -28,10 +27,20 @@ export const Avatar: React.FC<Props> = ({ height: `${size}px`, }; - const src = (hovering || animate) ? account?.get('avatar') : account?.get('avatar_static'); + const src = + hovering || animate + ? account?.get('avatar') + : account?.get('avatar_static'); return ( - <div className={classNames('account__avatar', { 'account__avatar-inline': inline })} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} style={style}> + <div + className={classNames('account__avatar', { + 'account__avatar-inline': inline, + })} + onMouseEnter={handleMouseEnter} + onMouseLeave={handleMouseLeave} + style={style} + > {src && <img src={src} alt={account?.get('acct')} />} </div> ); |