From d563034bb229d14470f2eaf976129ac01f3463c4 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Fri, 28 Mar 2025 11:14:03 +0200 Subject: [PATCH] Update the button style for Show LiveViews. --- .../live/author_live/show.ex | 4 +++- .../live/book_live/show.ex | 18 ++++-------------- .../live/dbi_server_live/show.ex | 4 +++- .../live/publisher_live/show.ex | 4 +++- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/decentralised_book_index_web/live/author_live/show.ex b/lib/decentralised_book_index_web/live/author_live/show.ex index fcb40d3..bcbcf37 100644 --- a/lib/decentralised_book_index_web/live/author_live/show.ex +++ b/lib/decentralised_book_index_web/live/author_live/show.ex @@ -10,7 +10,9 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Show do <:actions> <.link navigate={~p"/authors/#{@author}/edit"}> - <.button>Edit author + <.edit_button> + Edit + diff --git a/lib/decentralised_book_index_web/live/book_live/show.ex b/lib/decentralised_book_index_web/live/book_live/show.ex index 2d732c4..b8b02f4 100644 --- a/lib/decentralised_book_index_web/live/book_live/show.ex +++ b/lib/decentralised_book_index_web/live/book_live/show.ex @@ -9,8 +9,10 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do <:subtitle>This is a book record from your database. <:actions> - <.link patch={~p"/books/#{@book}/show/edit"} phx-click={JS.push_focus()}> - <.button>Edit book + <.link patch={~p"/books/#{@book}/edit"}> + <.edit_button> + Edit + @@ -34,18 +36,6 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do <.back navigate={~p"/books"}>Back to books - - <.modal :if={@live_action == :edit} id="book-modal" show on_cancel={JS.patch(~p"/books/#{@book}")}> - <.live_component - module={DecentralisedBookIndexWeb.BookLive.FormComponent} - id={@book.id} - title={@page_title} - action={@live_action} - current_user={@current_user} - book={@book} - patch={~p"/books/#{@book}"} - /> - """ end diff --git a/lib/decentralised_book_index_web/live/dbi_server_live/show.ex b/lib/decentralised_book_index_web/live/dbi_server_live/show.ex index 5548ca6..7fd6ed9 100644 --- a/lib/decentralised_book_index_web/live/dbi_server_live/show.ex +++ b/lib/decentralised_book_index_web/live/dbi_server_live/show.ex @@ -10,7 +10,9 @@ defmodule DecentralisedBookIndexWeb.DbiServerLive.Show do <:actions> <.link patch={~p"/dbi_servers/#{@dbi_server}/show/edit"} phx-click={JS.push_focus()}> - <.button>Edit dbi_server + <.edit_button> + Edit + diff --git a/lib/decentralised_book_index_web/live/publisher_live/show.ex b/lib/decentralised_book_index_web/live/publisher_live/show.ex index abf4dcb..7d77275 100644 --- a/lib/decentralised_book_index_web/live/publisher_live/show.ex +++ b/lib/decentralised_book_index_web/live/publisher_live/show.ex @@ -10,7 +10,9 @@ defmodule DecentralisedBookIndexWeb.PublisherLive.Show do <:actions> <.link patch={~p"/publishers/#{@publisher}/show/edit"} phx-click={JS.push_focus()}> - <.button>Edit publisher + <.edit_button> + Edit +