mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-13 11:41:00 +00:00
hide play button on playlist
This commit is contained in:
parent
5e3149ad8e
commit
0e0d349e31
3 changed files with 8 additions and 2 deletions
|
@ -534,6 +534,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
|
|||
assigns
|
||||
|> assign_new(:row_id, fn -> false 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))
|
||||
|
||||
~H"""
|
||||
|
@ -558,7 +559,8 @@ defmodule LiveBeatsWeb.LiveHelpers do
|
|||
row={row} col={@col}
|
||||
index={i}
|
||||
active_id={@active_id}
|
||||
class="hover:bg-gray-50"
|
||||
class="hover:bg-gray-50",
|
||||
owns_profile?={@owns_profile?}
|
||||
/>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
|
@ -58,6 +58,7 @@ defmodule LiveBeatsWeb.ProfileLive do
|
|||
module={SongRowComponent}
|
||||
rows={@songs}
|
||||
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="Artist"><%= song.artist %></:col>
|
||||
|
|
|
@ -28,7 +28,9 @@ defmodule LiveBeatsWeb.ProfileLive.SongRowComponent do
|
|||
<% 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"/>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -52,7 +54,8 @@ defmodule LiveBeatsWeb.ProfileLive.SongRowComponent do
|
|||
col: assigns.col,
|
||||
class: assigns.class,
|
||||
index: assigns.index,
|
||||
status: :stopped
|
||||
status: :stopped,
|
||||
owns_profile?: assigns.owns_profile?
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue