Add option for hiding close button in modal windows

This commit is contained in:
Râu Cao 2024-02-10 10:24:09 +01:00
parent 8747ce4eb0
commit ca238be6f4
Signed by: raucao
GPG Key ID: 37036C356E56CC51
2 changed files with 5 additions and 0 deletions

View File

@ -18,9 +18,11 @@
<div class="m-1 bg-white rounded shadow">
<div class="p-8">
<%= content %>
<% if @show_close_button %>
<div class="flex justify-end items-center flex-wrap mt-6">
<button class="btn-md btn-blue" data-action="click->modal#close:prevent">Close</button>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -1,2 +1,5 @@
class ModalComponent < ViewComponent::Base
def initialize(show_close_button: true)
@show_close_button = show_close_button
end
end