Skip to content

Commit

Permalink
Hide "Add attribute" button while an attribute is being added already.
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Dec 2, 2024
1 parent 4391d80 commit 13d02ce
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/beacon/live_admin/components/properties_sidebar_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ defmodule Beacon.LiveAdmin.PropertiesSidebarComponent do
<.live_component module={KeyValueControl} id={"control-key-value-#{@selected_element["path"]}-new"} element={@selected_element} />
<% end %>
<% end %>
<div class="p-4">
<button
type="button"
class="bg-blue-500 hover:bg-blue-700 active:bg-blue-800 text-white font-bold py-2 px-4 rounded outline-2 w-full"
phx-click="add_new_attribute"
disabled={@add_new_attribute}
phx-target={@myself}>
+ Add attribute
</button>
</div>
<%= if !@add_new_attribute do %>
<div class="p-4">
<button
type="button"
class="bg-blue-500 hover:bg-blue-700 active:bg-blue-800 text-white font-bold py-2 px-4 rounded outline-2 w-full"
phx-click="add_new_attribute"
phx-target={@myself}>
+ Add attribute
</button>
</div>
<% end %>
</div>
</div>
"""
Expand Down

0 comments on commit 13d02ce

Please sign in to comment.