add modal style

pull/105/head
Alex Turchyn 2 years ago
parent b8bae6d0e4
commit 81f376cf50

@ -9,6 +9,10 @@ import FileDropzone from './elements/file_dropzone'
import FlowBuilder from './flow_builder/builder' import FlowBuilder from './flow_builder/builder'
document.addEventListener('turbo:before-cache', () => {
window.flash?.remove()
})
window.customElements.define('toggle-visible', ToggleVisible) window.customElements.define('toggle-visible', ToggleVisible)
window.customElements.define('disable-hidden', DisableHidden) window.customElements.define('disable-hidden', DisableHidden)
window.customElements.define('turbo-modal', TurboModal) window.customElements.define('turbo-modal', TurboModal)

@ -1,9 +1,11 @@
<%= render 'shared/turbo_modal' do %> <%= render 'shared/turbo_modal', title: 'New Flow' do %>
<%= form_for @flow, data: { turbo_frame: :_top } do |f| %> <%= form_for @flow, data: { turbo_frame: :_top } do |f| %>
<div> <div class="form-control">
<%= f.label :name %> <%= f.label :name, 'Flow name', class: 'label' %>
<%= f.text_field :name, required: true %> <%= f.text_field :name, required: true, class: 'base-input' %>
</div>
<div class="form-control mt-4">
<%= f.button button_title('Create'), class: 'base-button' %>
</div> </div>
<%= f.button button_title %>
<% end %> <% end %>
<% end %> <% end %>

@ -1,11 +1,17 @@
<turbo-frame id="modal"> <turbo-frame id="modal">
<turbo-modal class="left-52 absolute top-0 z-50 bg-white h-[100vh] w-full"> <turbo-modal class="modal modal-open items-start">
<div> <div class="modal-box pt-4 pb-6 px-6 mt-20">
Modal window Title <% if local_assigns[:title] %>
<a href="#" data-action="click:turbo-modal#close">&times;</a> <div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
</div> <span>
<div> <%= local_assigns[:title] %>
<%= yield %> </span>
<a href="#" class="text-xl" data-action="click:turbo-modal#close">&times;</a>
</div>
<% end %>
<div>
<%= yield %>
</div>
</div> </div>
</turbo-modal> </turbo-modal>
</turbo-frame> </turbo-frame>

Loading…
Cancel
Save