0
0
Fork 0

New Crowdin updates (#24276)

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
This commit is contained in:
Eugen Rochko 2023-04-03 14:44:43 +02:00 committed by GitHub
parent 373e4a8ff0
commit 4909c2e718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 2266 additions and 1400 deletions

View file

@ -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>
);