mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-25 01:10:59 +00:00
pass through assign attrs in link#navigate helper
This commit is contained in:
parent
b5edfdd9cd
commit
306a16ba9c
1 changed files with 3 additions and 1 deletions
|
@ -124,9 +124,11 @@ defmodule LiveBeatsWeb.LiveHelpers do
|
|||
|
||||
def link(%{navigate: _to} = assigns) do
|
||||
assigns = assign_new(assigns, :class, fn -> nil end)
|
||||
opts = assigns_to_attributes(assigns, [:navigate])
|
||||
assigns = assign(assigns, :opts, opts)
|
||||
|
||||
~H"""
|
||||
<a href={@navigate} data-phx-link="redirect" data-phx-link-state="push" class={@class}>
|
||||
<a href={@navigate} data-phx-link="redirect" data-phx-link-state="push" {@opts}>
|
||||
<%= render_slot(@inner_block) %>
|
||||
</a>
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue