v3: added emoji picker, various bug and layout fixes

This commit is contained in:
khannurien
2026-03-22 20:24:29 +00:00
parent a104113e05
commit c5051e3485
24 changed files with 384 additions and 177 deletions

View File

@@ -6,18 +6,22 @@ interface AvatarProps {
username: string;
hasAvatar: boolean;
size?: number;
version?: number;
}
export function Avatar(
{ userId, username, hasAvatar, size = 36 }: AvatarProps,
{ userId, username, hasAvatar, size = 36, version }: AvatarProps,
) {
const [imgFailed, setImgFailed] = useState(false);
const sizeStyle = { width: size, height: size };
if (hasAvatar && !imgFailed) {
const src = version
? `${API_URL}/api/avatars/${userId}?v=${version}`
: `${API_URL}/api/avatars/${userId}`;
return (
<img
src={`${API_URL}/api/avatars/${userId}`}
src={src}
alt={username}
title={username}
style={sizeStyle}