Update nested forms style for Book FormComponent.
This commit is contained in:
@@ -12,6 +12,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents do
|
||||
import MyComponents.Buttons, only: [
|
||||
success_button: 1,
|
||||
primary_button: 1,
|
||||
add_button: 1,
|
||||
save_button: 1,
|
||||
edit_button: 1,
|
||||
cancel_button: 1,
|
||||
|
||||
@@ -69,6 +69,31 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
|
||||
|
||||
slot :inner_block, required: true
|
||||
|
||||
def add_button(assigns) do
|
||||
~H"""
|
||||
<.link
|
||||
class={[
|
||||
"phx-submit-loading:opacity-75 rounded-lg py-2 px-3 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-blue-800",
|
||||
"text-sm font-semibold leading-6 text-white active:text-white/80",
|
||||
"flex items-center gap-1",
|
||||
@class
|
||||
]}
|
||||
{@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">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/>
|
||||
</svg>
|
||||
{render_slot(@inner_block)}
|
||||
</.link>
|
||||
"""
|
||||
end
|
||||
|
||||
attr :type, :string, default: nil
|
||||
attr :class, :string, default: nil
|
||||
attr :rest, :global, include: ~w(disabled form name value)
|
||||
|
||||
slot :inner_block, required: true
|
||||
|
||||
def save_button(assigns) do
|
||||
~H"""
|
||||
<.success_button
|
||||
|
||||
Reference in New Issue
Block a user