fix(ui): paint avatar fallback gradient before broken-img onError
The fallback <div>'s inline style only carried `background` when src was falsy, so an <img> that 404'd flipped to display:flex via onError but with no gradient applied — surfacing a colorless letter for any broken avatar URL. Always paint the gradient + fontSize; keep `display:none` as the only src-conditional override.
This commit is contained in:
@@ -120,7 +120,7 @@ export function Avatar({ src, name, size = 40, status, className = '', onClick,
|
|||||||
) : null}
|
) : null}
|
||||||
<div
|
<div
|
||||||
className={`avatar-fallback w-full h-full rounded-full flex items-center justify-center font-bold text-white ${src ? 'hidden' : 'flex'}`}
|
className={`avatar-fallback w-full h-full rounded-full flex items-center justify-center font-bold text-white ${src ? 'hidden' : 'flex'}`}
|
||||||
style={src ? { display: 'none' } : { background: gradient.gradient, fontSize: fontPx }}
|
style={{ background: gradient.gradient, fontSize: fontPx, ...(src ? { display: 'none' } : {}) }}
|
||||||
>
|
>
|
||||||
{initials}
|
{initials}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user