Skip to content

Commit 7b2faeb

Browse files
committed
fix: update avatar_group component to increase limit and enhance styling
- Increased the default limit of displayed avatars in the `avatar_group` component from 3 to 4. - Improved avatar styling by adding a ring effect for better visual distinction. - Updated usage in `BountyLive` to reflect the new default limit and styling adjustments.
1 parent 399f574 commit 7b2faeb

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/algora_web/components/ui/avatar.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ defmodule AlgoraWeb.Components.UI.Avatar do
5454
attr :class, :string, default: nil
5555
attr :rest, :global
5656
attr :srcs, :list, default: []
57-
attr :limit, :integer, default: 3
57+
attr :limit, :integer, default: 4
5858

5959
def avatar_group(assigns) do
6060
~H"""
6161
<div class="relative flex -space-x-1">
6262
<%= for src <- @srcs |> Enum.take(@limit) do %>
63-
<.avatar class={@class}>
63+
<.avatar class={classes(["ring-4 ring-background", @class])}>
6464
<.avatar_image src={src} />
6565
<.avatar_fallback>
6666
{Algora.Util.initials(src)}
6767
</.avatar_fallback>
6868
</.avatar>
6969
<% end %>
7070
<%= if length(@srcs) > @limit do %>
71-
<.avatar class={@class}>
71+
<.avatar class={classes(["ring-4 ring-background", @class])}>
7272
<.avatar_fallback>
7373
+{length(@srcs) - @limit}
7474
</.avatar_fallback>

lib/algora_web/live/bounty_live.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,7 @@ defmodule AlgoraWeb.BountyLive do
472472
Contributor chat
473473
</h2>
474474
475-
<.avatar_group
476-
srcs={Enum.map(@participants, & &1.user.avatar_url)}
477-
limit={4}
478-
class="ring-4 ring-background"
479-
/>
475+
<.avatar_group srcs={Enum.map(@participants, & &1.user.avatar_url)} />
480476
</div>
481477
</div>
482478

0 commit comments

Comments
 (0)