fixed UserRound sizing

This commit is contained in:
Oliver Bryan
2026-01-03 13:20:42 +00:00
parent 5160a6a554
commit 6e8ffa0885
2 changed files with 12 additions and 2 deletions

View File

@@ -129,6 +129,7 @@
font-optical-sizing: auto; font-optical-sizing: auto;
font-weight: 500; font-weight: 500;
font-style: normal; font-style: normal;
font-variant-ligatures: none;
} }
.font-300 { .font-300 {

View File

@@ -1,4 +1,5 @@
import { UserRound } from "lucide-react"; import { UserRound } from "lucide-react";
import { cn } from "@/lib/utils";
const FALLBACK_COLOURS = [ const FALLBACK_COLOURS = [
"bg-red-500", "bg-red-500",
@@ -58,7 +59,15 @@ export default function Avatar({
return ( return (
<div <div
className={`flex items-center justify-center rounded-full text-white font-medium select-none ${name && "border"} ${!avatarURL && backgroundClass} w-${size || 6} h-${size || 6}`} className={cn(
"flex items-center justify-center rounded-full",
"text-white font-medium select-none",
name && "border",
!avatarURL && backgroundClass,
"transition-colors",
`w-${size || 6}`,
`h-${size || 6}`,
)}
> >
{avatarURL ? ( {avatarURL ? (
<img <img
@@ -69,7 +78,7 @@ export default function Avatar({
) : name ? ( ) : name ? (
<span className={textClass}>{getInitials(name)}</span> <span className={textClass}>{getInitials(name)}</span>
) : ( ) : (
<UserRound size={size ? size * 2 + 2 : 14} /> <UserRound className={"size-10"} />
)} )}
</div> </div>
); );