mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-06-16 12:20:34 +00:00
fix: use <.link> to patch url
This commit is contained in:
parent
d4f83e1a4b
commit
7a638e345c
|
@ -517,15 +517,21 @@ defmodule LiveBeatsWeb.CoreComponents do
|
||||||
def button(%{patch: _} = assigns) do
|
def button(%{patch: _} = assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<%= if @primary do %>
|
<%= if @primary do %>
|
||||||
<%= live_patch [to: @patch, class: "order-0 inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 sm:order-1 sm:ml-3"] ++
|
<.link
|
||||||
Map.to_list(@rest) do %>
|
patch={@patch}
|
||||||
|
class="order-0 inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 sm:order-1 sm:ml-3"
|
||||||
|
{@rest}
|
||||||
|
>
|
||||||
<%= render_slot(@inner_block) %>
|
<%= render_slot(@inner_block) %>
|
||||||
<% end %>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= live_patch [to: @patch, class: "order-1 inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 sm:order-0 sm:ml-0 lg:ml-3"] ++
|
<.link
|
||||||
assigns_to_attributes(assigns, [:primary, :patch]) do %>
|
patch={@patch}
|
||||||
|
class="order-1 inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 sm:order-0 sm:ml-0 lg:ml-3"
|
||||||
|
{@rest}
|
||||||
|
>
|
||||||
<%= render_slot(@inner_block) %>
|
<%= render_slot(@inner_block) %>
|
||||||
<% end %>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue