fix: show user small picture and fallback when loading (#63)

* fix: show user small picture and fallback when loading

* fix: add alt to avatar

* fix: fixed version
This commit is contained in:
Matthieu Ev
2025-08-03 08:57:00 +02:00
committed by GitHub
parent a14b0535ec
commit b3af64dce1

View File

@@ -1,7 +1,8 @@
<%# locals: (avatar_url: nil, initials: "U", lazy: false) %>
<% if avatar_url.present? %>
<%= image_tag avatar_url, class: "rounded-full w-full h-full object-cover", loading: lazy ? "lazy" : "eager" %>
<% else %>
<div class="w-full h-full bg-surface-inset hover:bg-surface-inset-hover text-secondary rounded-full flex items-center justify-center text-lg uppercase"><%= initials %></div>
<% end %>
<div class="w-full h-full bg-surface-inset hover:bg-surface-inset-hover text-secondary rounded-full flex items-center justify-center text-lg uppercase relative">
<%= initials %>
<% if avatar_url.present? %>
<%= image_tag avatar_url, class: "absolute inset-0 rounded-full w-full h-full object-cover", loading: lazy ? "lazy" : "eager" %>
<% end %>
</div>