hide play button on playlist

This commit is contained in:
Berenice Medel 2021-11-23 11:52:43 -06:00
parent 5e3149ad8e
commit 0e0d349e31
3 changed files with 8 additions and 2 deletions

View file

@ -534,6 +534,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
assigns assigns
|> assign_new(:row_id, fn -> false end) |> assign_new(:row_id, fn -> false end)
|> assign_new(:active_id, fn -> nil end) |> assign_new(:active_id, fn -> nil end)
|> assign_new(:owns_profile?, fn -> assigns.owns_profile? end)
|> assign(:col, for(col <- assigns.col, col[:if] != false, do: col)) |> assign(:col, for(col <- assigns.col, col[:if] != false, do: col))
~H""" ~H"""
@ -558,7 +559,8 @@ defmodule LiveBeatsWeb.LiveHelpers do
row={row} col={@col} row={row} col={@col}
index={i} index={i}
active_id={@active_id} active_id={@active_id}
class="hover:bg-gray-50" class="hover:bg-gray-50",
owns_profile?={@owns_profile?}
/> />
<% end %> <% end %>
</tbody> </tbody>

View file

@ -58,6 +58,7 @@ defmodule LiveBeatsWeb.ProfileLive do
module={SongRowComponent} module={SongRowComponent}
rows={@songs} rows={@songs}
row_id={fn song -> "song-#{song.id}" end} row_id={fn song -> "song-#{song.id}" end}
owns_profile?= {@owns_profile?}
> >
<:col let={%{song: song}} label="Title"><%= song.title %></:col> <:col let={%{song: song}} label="Title"><%= song.title %></:col>
<:col let={%{song: song}} label="Artist"><%= song.artist %></:col> <:col let={%{song: song}} label="Artist"><%= song.artist %></:col>

View file

@ -28,7 +28,9 @@ defmodule LiveBeatsWeb.ProfileLive.SongRowComponent do
<% end %> <% end %>
<%= if @status == :stopped do %> <%= if @status == :stopped do %>
<span class="flex relative w-6 -translate-x-1"> <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"/>
<% end %>
</span> </span>
<% end %> <% end %>
<% end %> <% end %>
@ -52,7 +54,8 @@ defmodule LiveBeatsWeb.ProfileLive.SongRowComponent do
col: assigns.col, col: assigns.col,
class: assigns.class, class: assigns.class,
index: assigns.index, index: assigns.index,
status: :stopped status: :stopped,
owns_profile?: assigns.owns_profile?
)} )}
end end
end end