1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 23:45:21 +02:00
This commit is contained in:
neo773 2025-04-14 07:36:01 +05:30
parent 2e1ab8101f
commit 53c8259a72
No known key found for this signature in database
GPG key ID: 6B43F29FCC69B333
3 changed files with 41 additions and 3 deletions

View file

@ -40,7 +40,17 @@ module SettingsHelper
previous_setting = adjacent_setting(request.path, -1)
next_setting = adjacent_setting(request.path, 1)
content_tag :div, class: "flex justify-between gap-4" do
content_tag :div, class: "hidden md:flex flex-row justify-between gap-4" do
concat(previous_setting)
concat(next_setting)
end
end
def settings_nav_footer_mobile
previous_setting = adjacent_setting(request.path, -1)
next_setting = adjacent_setting(request.path, 1)
content_tag :div, class: "md:hidden flex flex-col gap-4" do
concat(previous_setting)
concat(next_setting)
end

View file

@ -4,7 +4,7 @@
<%= render "settings/settings_nav" %>
</div>
<main class="px-4 pt-2 pb-24 md:py-4 md:px-10 grow flex h-full overflow-y-auto">
<main class="px-4 pt-2 md:py-4 md:px-10 grow flex h-full overflow-y-auto">
<div class="relative max-w-4xl mx-auto flex flex-col w-full h-full">
<div class="grow space-y-4 overflow-y-auto -mx-1 px-1 pb-12">
<% if content_for?(:breadcrumbs) %>
@ -20,6 +20,7 @@
<% end %>
<%= yield %>
<%= settings_nav_footer_mobile %>
</div>
<div class="mt-4">

View file

@ -1,5 +1,5 @@
<%# locals: path, direction, title %>
<%= link_to path, class: "w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs p-4 flex items-center justify-between" do %>
<%= link_to path, class: "hidden md:flex w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs p-4 items-center justify-between" do %>
<% if direction == 'previous' %>
<div class="w-5 h-5 text-secondary">
<%= lucide_icon("arrow-left") %>
@ -15,3 +15,30 @@
</div>
<% end %>
<% end %>
<%# Mobile version %>
<%= link_to path, class: "md:hidden w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs py-3 px-4" do %>
<div class="flex items-center justify-between">
<% if direction == 'previous' %>
<div class="flex items-center gap-3">
<div class="w-5 h-5 text-secondary">
<%= lucide_icon("arrow-left") %>
</div>
<span class="text-sm text-secondary">Back</span>
</div>
<div>
<span class="text-sm font-medium text-primary"><%= title %></span>
</div>
<% else %>
<div>
<span class="text-sm text-secondary">Next</span>
</div>
<div class="flex items-center gap-3">
<span class="text-sm font-medium text-primary"><%= title %></span>
<div class="w-5 h-5 text-secondary">
<%= lucide_icon("arrow-right") %>
</div>
</div>
<% end %>
</div>
<% end %>