mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-12-18 05:06:31 +00:00
Hide icons with associated buttons from accessibility tree.
This commit is contained in:
parent
364b0659e1
commit
f7db67f636
3 changed files with 12 additions and 8 deletions
|
@ -41,7 +41,7 @@ defmodule LiveBeatsWeb.PlayerLive do
|
||||||
redirect_to={profile_path(@profile)}
|
redirect_to={profile_path(@profile)}
|
||||||
class="mx-auto flex outline border-2 border-white border-opacity-20 rounded-md p-1 pr-2"
|
class="mx-auto flex outline border-2 border-white border-opacity-20 rounded-md p-1 pr-2"
|
||||||
>
|
>
|
||||||
<span class="mt-1"><.icon name={:user_circle}/></span>
|
<span class="mt-1"><.icon name={:user_circle} aria-hidden="true"/></span>
|
||||||
<p class="ml-2"><%= @profile.username %></p>
|
<p class="ml-2"><%= @profile.username %></p>
|
||||||
</.link>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -221,7 +221,10 @@ defmodule LiveBeatsWeb.PlayerLive do
|
||||||
{:noreply, play_current_song(socket)}
|
{:noreply, play_current_song(socket)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_info({Accounts, %Accounts.Events.ActiveProfileChanged{new_profile_user_id: user_id}}, socket) do
|
def handle_info(
|
||||||
|
{Accounts, %Accounts.Events.ActiveProfileChanged{new_profile_user_id: user_id}},
|
||||||
|
socket
|
||||||
|
) do
|
||||||
if user_id do
|
if user_id do
|
||||||
{:noreply, assign(socket, profile: get_profile(user_id))}
|
{:noreply, assign(socket, profile: get_profile(user_id))}
|
||||||
else
|
else
|
||||||
|
|
|
@ -13,7 +13,7 @@ defmodule LiveBeatsWeb.SongLive.Index do
|
||||||
<%= @profile.tagline %> <%= if @owns_profile? do %>(you)<% end %>
|
<%= @profile.tagline %> <%= if @owns_profile? do %>(you)<% end %>
|
||||||
</div>
|
</div>
|
||||||
<.link href={@profile.external_homepage_url} _target="blank" class="block text-sm text-gray-600">
|
<.link href={@profile.external_homepage_url} _target="blank" class="block text-sm text-gray-600">
|
||||||
<.icon name={:code}/> <span class=""><%= url_text(@profile.external_homepage_url) %></span>
|
<.icon name={:code} aria-hidden="true"/> <span class=""><%= url_text(@profile.external_homepage_url) %></span>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -22,18 +22,18 @@ defmodule LiveBeatsWeb.SongLive.Index do
|
||||||
<.button primary
|
<.button primary
|
||||||
phx-click={JS.push("switch_profile", value: %{user_id: nil}, target: "#player", loading: "#player")}
|
phx-click={JS.push("switch_profile", value: %{user_id: nil}, target: "#player", loading: "#player")}
|
||||||
>
|
>
|
||||||
<.icon name={:stop}/><span class="ml-2">Stop Listening</span>
|
<.icon name={:stop} aria-hidden="true"/><span class="ml-2">Stop Listening</span>
|
||||||
</.button>
|
</.button>
|
||||||
<% else %>
|
<% else %>
|
||||||
<.button primary
|
<.button primary
|
||||||
phx-click={JS.push("switch_profile", value: %{user_id: @profile.user_id}, target: "#player", loading: "#player")}
|
phx-click={JS.push("switch_profile", value: %{user_id: @profile.user_id}, target: "#player", loading: "#player")}
|
||||||
>
|
>
|
||||||
<.icon name={:play}/><span class="ml-2">Listen</span>
|
<.icon name={:play} aria-hidden="true"/><span class="ml-2">Listen</span>
|
||||||
</.button>
|
</.button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= if @owns_profile? do %>
|
<%= if @owns_profile? do %>
|
||||||
<.button primary patch_to={Routes.song_index_path(@socket, :new)}>
|
<.button primary patch_to={Routes.song_index_path(@socket, :new)}>
|
||||||
<.icon name={:upload}/><span class="ml-2">Upload Songs</span>
|
<.icon name={:upload} aria-hidden="true"/><span class="ml-2">Upload Songs</span>
|
||||||
</.button>
|
</.button>
|
||||||
<% end %>
|
<% end %>
|
||||||
</:actions>
|
</:actions>
|
||||||
|
@ -236,6 +236,7 @@ defmodule LiveBeatsWeb.SongLive.Index do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp url_text(nil), do: ""
|
defp url_text(nil), do: ""
|
||||||
|
|
||||||
defp url_text(url_str) do
|
defp url_text(url_str) do
|
||||||
uri = URI.parse(url_str)
|
uri = URI.parse(url_str)
|
||||||
uri.host <> uri.path
|
uri.host <> uri.path
|
||||||
|
|
|
@ -35,7 +35,7 @@ defmodule LiveBeatsWeb.LayoutView do
|
||||||
redirect_to={profile_path(@current_user)}
|
redirect_to={profile_path(@current_user)}
|
||||||
class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md"
|
class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md"
|
||||||
>
|
>
|
||||||
<.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/>
|
<.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/>
|
||||||
My Songs
|
My Songs
|
||||||
</.link>
|
</.link>
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ defmodule LiveBeatsWeb.LayoutView do
|
||||||
redirect_to={Routes.settings_path(LiveBeatsWeb.Endpoint, :edit)}
|
redirect_to={Routes.settings_path(LiveBeatsWeb.Endpoint, :edit)}
|
||||||
class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md"
|
class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md"
|
||||||
>
|
>
|
||||||
<.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/>
|
<.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/>
|
||||||
Settings
|
Settings
|
||||||
</.link>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
Loading…
Reference in a new issue