mirror of
https://github.com/fly-apps/live_beats.git
synced 2025-01-20 20:08:07 +00:00
fix(icon): set outline/solid styles correctly.
On version 0.5.0, each outline style (`outline`, `solid`, `mini`, `micro`) is defined by individual attributes. So, the `icon` component uses these new attributes in the place of `Heroicons.Solid` and `Heroicons.Outline`.
This commit is contained in:
parent
94814ce86f
commit
a2954526af
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