If an icon has aria-labelset, don't set aria-hidden. Also, label some icons.

This commit is contained in:
Nolan Darilek 2021-12-16 15:25:51 -06:00
parent c8a6035a02
commit 3860c79ec7
2 changed files with 4 additions and 4 deletions

View file

@ -123,7 +123,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
assigns
|> assign_new(:outlined, fn -> false end)
|> assign_new(:class, fn -> "w-4 h-4 inline-block" end)
|> assign_new(:"aria-hidden", fn -> "true" end)
|> assign_new(:"aria-hidden", fn -> !Map.has_key?(assigns, :"aria-label") end)
~H"""
<%= if @outlined do %>

View file

@ -18,18 +18,18 @@ defmodule LiveBeatsWeb.ProfileLive.SongRowComponent do
<%= if @status == :playing do %>
<span class="flex pt-1 relative mr-2 w-4">
<span class="w-3 h-3 animate-ping bg-purple-400 rounded-full absolute"></span>
<.icon name={:volume_up} class="h-5 w-5 -mt-1 -ml-1"/>
<.icon name={:volume_up} class="h-5 w-5 -mt-1 -ml-1" aria-label="Playing"/>
</span>
<% end %>
<%= if @status == :paused do %>
<span class="flex pt-1 relative mr-2 w-4">
<.icon name={:volume_up} class="h-5 w-5 -mt-1 -ml-1 text-gray-400"/>
<.icon name={:volume_up} class="h-5 w-5 -mt-1 -ml-1 text-gray-400" aria-label="Paused"/>
</span>
<% end %>
<%= if @status == :stopped do %>
<span class="flex relative w-6 -translate-x-1">
<%= if @owns_profile? do %>
<.icon name={:play} class="h-5 w-5 text-gray-400"/>
<.icon name={:play} class="h-5 w-5 text-gray-400" aria-label="Play"/>
<% end %>
</span>
<% end %>