Update the add_button to add_button_link and remove the extra links.

dev
KKlochko 2 months ago
parent ebbee7f9a5
commit ca1c9c05d2

@ -17,7 +17,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents do
only: [ only: [
success_button: 1, success_button: 1,
primary_button: 1, primary_button: 1,
add_button: 1, add_button_link: 1,
save_button: 1, save_button: 1,
edit_button: 1, edit_button: 1,
cancel_button: 1 cancel_button: 1

@ -69,7 +69,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
slot :inner_block, required: true slot :inner_block, required: true
def add_button(assigns) do def add_button_link(assigns) do
~H""" ~H"""
<.link <.link
class={[ class={[
@ -80,8 +80,22 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
]} ]}
{@rest} {@rest}
> >
<svg class="w-6 h-6 text-white dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> <svg
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/> class="w-6 h-6 text-white dark:text-white"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 12h14m-7 7V5"
/>
</svg> </svg>
{render_slot(@inner_block)} {render_slot(@inner_block)}
</.link> </.link>

@ -12,11 +12,9 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Show do
<:actions> <:actions>
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %> <%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %>
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<.link patch={~p"/authors/#{@author}/new"}> <.add_button_link patch={~p"/authors/#{@author}/new"}>
<.add_button> Alias
Alias </.add_button_link>
</.add_button>
</.link>
<.link patch={~p"/authors/#{@author}/edit"}> <.link patch={~p"/authors/#{@author}/edit"}>
<.edit_button> <.edit_button>
Edit Edit

@ -169,10 +169,9 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
</tbody> </tbody>
</table> </table>
<.add_button phx-click="add-bid" phx-target={@myself} class="w-44"> <.add_button_link phx-click="add-bid" phx-target={@myself} class="w-44">
Add Book Id Add Book Id
</.add_button> </.add_button_link>
""" """
end end
@ -260,9 +259,9 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
</tbody> </tbody>
</table> </table>
<.add_button phx-click="add-author-role" phx-target={@myself} class="w-40"> <.add_button_link phx-click="add-author-role" phx-target={@myself} class="w-40">
Add Author Add Author
</.add_button> </.add_button_link>
""" """
end end

@ -16,11 +16,9 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
<:actions> <:actions>
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %> <%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %>
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<.link patch={~p"/books/#{@book}/new"}> <.add_button_link patch={~p"/books/#{@book}/new"}>
<.add_button> Edition
Edition </.add_button_link>
</.add_button>
</.link>
<.link patch={~p"/books/#{@book}/edit"}> <.link patch={~p"/books/#{@book}/edit"}>
<.edit_button> <.edit_button>
Edit Edit

Loading…
Cancel
Save