From cc0f4665973eef678852b445d458612c64c33a4c Mon Sep 17 00:00:00 2001 From: Virginia Dooley <7017118+VirginiaDooley@users.noreply.github.com> Date: Thu, 13 Nov 2025 09:40:36 +0000 Subject: [PATCH 1/6] Optimise nav for mobile --- app/views/dashboard/_address_search.html.erb | 40 ++++++++----------- app/views/dashboard/_home.html.erb | 14 +++---- app/views/dashboard/_progress_map.html.erb | 32 +++++++-------- app/views/dashboard/index.html.erb | 10 ++--- app/views/layouts/application.html.erb | 27 +++++++------ .../_representatives_table.html.erb | 36 ++++++++--------- 6 files changed, 78 insertions(+), 81 deletions(-) diff --git a/app/views/dashboard/_address_search.html.erb b/app/views/dashboard/_address_search.html.erb index 7fe93869..b4c74545 100644 --- a/app/views/dashboard/_address_search.html.erb +++ b/app/views/dashboard/_address_search.html.erb @@ -1,28 +1,22 @@ -
- -
-
-
-
- <%= form_with url: dashboard_panel_path('address_search'), method: :post, data: { turbo_frame: 'main-panel' }, html: { class: "space-y-4" } do |form| %> -
- <%= form.label :address, "Enter your address", class: "block text-sm font-medium text-gray-700 mb-1" %> - <%= form.text_field :address, placeholder: "e.g., 123 Main St, City, State, Zip Code", class: "w-full py-3 px-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500", autocomplete: "off" %> -
-
- <%= form.submit "Find My Representatives", class: "w-full sm:w-auto bg-blue-500 hover:bg-blue-700 text-white font-bold py-3 px-6 border border-blue-700 rounded-lg text-lg" %> -
- <% end %> +
+
+ <%= form_with url: dashboard_panel_path('address_search'), method: :post, data: { turbo_frame: 'main-panel' }, html: { class: "space-y-3 sm:space-y-4" } do |form| %> +
+ <%= form.label :address, "Enter your address", class: "block text-xs sm:text-sm font-medium text-gray-700 mb-1" %> + <%= form.text_field :address, placeholder: "123 Main St, City, State, Zip", class: "w-full py-2.5 sm:py-3 px-3 sm:px-4 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500", autocomplete: "off" %> +
+
+ <%= form.submit "Find My Representatives", class: "inline-flex items-center bg-blue-500 hover:bg-blue-700 text-white font-semibold py-3 sm:py-3.5 px-4 sm:px-5 border border-blue-700 rounded-lg text-sm sm:text-base" %> +
+ <% end %> - <%# Support both locals and instance variables for Turbo and non-Turbo renders %> - <% reps = (defined?(representatives) ? representatives : @representatives) %> - <% did_search = (defined?(searched) ? searched : @searched) %> - <% if did_search %> -
- <%= render partial: 'representatives_table', locals: { representatives: reps } %> -
- <% end %> + <%# Support both locals and instance variables for Turbo and non-Turbo renders %> + <% reps = (defined?(representatives) ? representatives : @representatives) %> + <% did_search = (defined?(searched) ? searched : @searched) %> + <% if did_search %> +
+ <%= render partial: 'representatives_table', locals: { representatives: reps } %>