mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 22:34:47 +00:00
* feat: Add responsive dialog behavior for transaction modals Add responsive option to DS::Dialog component that switches between: - Mobile (< 1024px): Modal style (centered) with inline close button - Desktop (≥ 1024px): Drawer style (right side panel) with header close button Update transaction, transfer, holding, trade, and valuation views to use responsive behavior, maintaining mobile experience while reverting desktop to drawer style like budget categories. Changes: - app/components/DS/dialog.rb: Add responsive parameter and helper methods - app/components/DS/dialog.html.erb: Apply responsive styling - app/views/*/show.html.erb: Add responsive: true and hide close icons on mobile * fix: Enhance close button accessibility in dialog components * fix: Refactor dialog component to improve close button handling and accessibility
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
<%= wrapper_element do %>
|
|
<%= tag.dialog class: "w-full h-full bg-transparent theme-dark:backdrop:bg-alpha-black-900 backdrop:bg-overlay pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] #{(drawer? || responsive?) ? "lg:p-3" : "lg:p-1"}", **merged_opts do %>
|
|
<%= tag.div class: dialog_outer_classes do %>
|
|
<%= tag.div class: dialog_inner_classes, data: { DS__dialog_target: "content" } do %>
|
|
<div class="grow overflow-y-auto py-4 space-y-4 flex flex-col">
|
|
<% if header? %>
|
|
<%= header %>
|
|
<% end %>
|
|
<% if body? %>
|
|
<div class="px-4 grow">
|
|
<%= body %>
|
|
<% if sections.any? %>
|
|
<div class="space-y-4">
|
|
<% sections.each do |section| %>
|
|
<%= section %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<%# Optional, for customizing dialogs %>
|
|
<%= content %>
|
|
</div>
|
|
<% if actions? %>
|
|
<div class="flex items-center gap-2 justify-end p-4">
|
|
<% actions.each do |action| %>
|
|
<%= action %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|