Working on received marker

This commit is contained in:
2023-11-27 01:04:40 +00:00
parent c12ded9318
commit e31db2f5e8
6 changed files with 74 additions and 4 deletions

View File

@@ -16,9 +16,9 @@
}
id="items-grid"
>
<.link
<div
:for={item <- @items}
navigate={~p"/details/#{item}"}
phx-click={JS.navigate(~p"/details/#{item}")}
class={[
"p-2 rounded hover:bg-zinc-100 active:bg-zinc-200",
case @display do
@@ -37,6 +37,24 @@
class="rounded"
/>
</div>
<%= item.title %>
</.link>
<%= if item.received do %>
<div class="bg-red-400 text-white">
<.icon name="hero-check-circle" />Received
</div>
<% end %>
<div class="flex flex-row justify-between">
<%= item.title %>
<div phx-click={JS.toggle(to: "#dropdown-#{item.id}")} class="relative">
<.icon name="hero-ellipsis-vertical" class="w-7 h-7" />
<div
id={"dropdown-#{item.id}"}
class="absolute z-10 bg-white origin-top right-0 whitespace-nowrap"
phx-click={JS.push("toggle_received", value: %{"id" => item.id})}
hidden
>
Mark visible
</div>
</div>
</div>
</div>
</div>