settings_hub 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73c451e65d050963812a29c8be8c77a98b0486469d8ac6d5340fb56f4efa6456
4
- data.tar.gz: 74038ba04e7228647ae1da109b00b6de3d601e8ecd3e9780512b4c2a297be366
3
+ metadata.gz: e34e19840a9d304ce449cbb4a8c2e1006a4ca82e36a3bbad4e94cc5f40f4bcc4
4
+ data.tar.gz: b5b90d4f96e13fb27d54a3940273d0c24686dca33e6b4f4d6ff2e4137f5b6988
5
5
  SHA512:
6
- metadata.gz: 1afe447071e4cb8377109ceaa267e8c94b40c46ef6da9b0d3481c827e3cb5fd75e940797cd589377830149b49f9c53be04419f962faf98ec8573acaf348290df
7
- data.tar.gz: 4678adb41ce2746ffef96b1630e4bf250a1a38ba1acaeb70b76ab97dd7e5fd3fd7795d54902e6ed5fcdfd28dcfa4ec2152e27e6bb40eb7223bcd4a174120d182
6
+ metadata.gz: d1655307c906df9f7e47460cb46869180f7ce36d8e5a86fa2c1215df543c89efdfced9481d5a33f43149eda988226d5c9c4db55e68057021181297c0d3772ccf
7
+ data.tar.gz: ab8f2dc3aaf1efff4dd9286b8d0d64bf010cd53f092cf16189fffd78556956af2ed9ca1e77c4d67c7a2d25fdd24df541d6a0a52ebc587a0de518603235265ef7
@@ -1,4 +1,7 @@
1
1
  module SettingsHub
2
2
  module ApplicationHelper
3
+ def settings_in_native_app?
4
+ request.user_agent.to_s.include?("Hotwire Native")
5
+ end
3
6
  end
4
7
  end
@@ -1,20 +1,36 @@
1
1
  <%= ui_page(max_width: :xl) do %>
2
- <%= ui_page_header(title: "Settings") %>
2
+ <%= tag.div(class: class_names("hidden lg:block": @section)) do %>
3
+ <%= ui_page_header(title: "Settings") %>
4
+ <% end %>
3
5
 
4
- <%= ui_grid(cols: { default: 1, lg: 2 }, gap: :lg) do %>
5
- <%= ui_section do %>
6
+ <% if @section %>
7
+ <%= ui_mobile_header(title: @section.title, back_url: settings_path) unless settings_in_native_app? %>
8
+ <% else %>
9
+ <div class="lg:hidden">
6
10
  <% @areas.each do |area, sections| %>
7
- <section aria-label="<%= area.to_s.titleize %>">
8
- <%= ui_section(title: area.to_s.titleize) do %>
9
- <%= ui_panel do %>
10
- <nav aria-label="Settings">
11
- <% sections.each do |section| %>
12
- <%= link_to section.title, section.at || section_path(section.key), "aria-current": ("page" if section == @section) %>
13
- <% end %>
14
- </nav>
11
+ <%= ui_section(title: area.to_s.titleize) do %>
12
+ <%= ui_link_list(rows: sections.map { |section| { label: section.title, href: section.at || section_path(section.key) } }) %>
13
+ <% end %>
14
+ <% end %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <%= ui_grid(cols: { default: 1, lg: 2 }, gap: :lg) do %>
19
+ <%= tag.div(class: "hidden lg:block") do %>
20
+ <%= ui_section do %>
21
+ <% @areas.each do |area, sections| %>
22
+ <section aria-label="<%= area.to_s.titleize %>">
23
+ <%= ui_section(title: area.to_s.titleize) do %>
24
+ <%= ui_panel do %>
25
+ <nav aria-label="Settings" data-turbo-prefetch="false">
26
+ <% sections.each do |section| %>
27
+ <%= link_to section.title, section.at || section_path(section.key), "aria-current": ("page" if section == @section) %>
28
+ <% end %>
29
+ </nav>
30
+ <% end %>
15
31
  <% end %>
16
- <% end %>
17
- </section>
32
+ </section>
33
+ <% end %>
18
34
  <% end %>
19
35
  <% end %>
20
36
 
@@ -1,3 +1,3 @@
1
1
  module SettingsHub
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: settings_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider