mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-15 20:51:03 +00:00
chore: Upgrade heroicon usage
This commit is contained in:
parent
c9b918d499
commit
f70f363f0a
1 changed files with 7 additions and 6 deletions
|
@ -149,14 +149,15 @@ defmodule LiveBeatsWeb.CoreComponents do
|
|||
attr :rest, :global, default: %{class: "w-4 h-4 inline-block"}
|
||||
|
||||
def icon(assigns) do
|
||||
assigns = assign_new(assigns, :"aria-hidden", fn -> !Map.has_key?(assigns, :"aria-label") end)
|
||||
key = if Map.get(assigns, :outlined, false), do: :outline, else: :solid
|
||||
|
||||
assigns =
|
||||
assigns
|
||||
|> assign_new(:"aria-hidden", fn -> !Map.has_key?(assigns, :"aria-label") end)
|
||||
|> assign(key, true)
|
||||
|
||||
~H"""
|
||||
<%= if @outlined do %>
|
||||
<%= apply(Heroicons.Outline, @name, [Map.to_list(@rest)]) %>
|
||||
<% else %>
|
||||
<%= apply(Heroicons.Solid, @name, [Map.to_list(@rest)]) %>
|
||||
<% end %>
|
||||
<%= apply(Heroicons, @name, [assigns]) %>
|
||||
"""
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue