From 9ff7356113d91a49d95bcdebdbed14f605848645 Mon Sep 17 00:00:00 2001 From: teesloane Date: Mon, 30 Oct 2023 06:00:10 -0400 Subject: [PATCH 1/2] Fix: mobile styling for campaign modal - also, shrink modal padding on mobile to have more space - change campaign dates into a column on mobile - change live location picker to put fields into columns on mobile --- .../components/live_location.ex | 55 ++++++++++--------- lib/bike_brigade_web/core_components.ex | 2 +- .../campaign_live/form_component.html.heex | 2 +- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/bike_brigade_web/components/live_location.ex b/lib/bike_brigade_web/components/live_location.ex index 96d89b92..9d8c17cc 100644 --- a/lib/bike_brigade_web/components/live_location.ex +++ b/lib/bike_brigade_web/components/live_location.ex @@ -64,8 +64,7 @@ defmodule BikeBrigadeWeb.Components.LiveLocation do location = %Location{} changeset = Location.changeset(location) - {location, changeset - } + {location, changeset} end form = Phoenix.HTML.FormData.to_form(changeset, as: as) @@ -173,8 +172,8 @@ defmodule BikeBrigadeWeb.Components.LiveLocation do
-
-
+
+
@@ -188,30 +187,32 @@ defmodule BikeBrigadeWeb.Components.LiveLocation do
<%= error_tag(@form, :address, show_field: false) %>
-
- -
- <%= text_input(@form, :unit, - phx_change: "change", - phx_target: @myself, - class: - "block w-full px-3 py-2 placeholder-gray-400 transition duration-150 ease-in-out border border-gray-300 rounded-md appearance-none focus:outline-none focus:ring-blue focus:border-blue-300 sm:text-sm sm:leading-5" - ) %> +
+
+ +
+ <%= text_input(@form, :unit, + phx_change: "change", + phx_target: @myself, + class: + "block w-full px-3 py-2 placeholder-gray-400 transition duration-150 ease-in-out border border-gray-300 rounded-md appearance-none focus:outline-none focus:ring-blue focus:border-blue-300 sm:text-sm sm:leading-5" + ) %> +
-
-
- -
- <%= text_input(@form, :buzzer, - phx_change: "change", - phx_target: @myself, - class: - "block w-full px-3 py-2 placeholder-gray-400 transition duration-150 ease-in-out border border-gray-300 rounded-md appearance-none focus:outline-none focus:ring-blue focus:border-blue-300 sm:text-sm sm:leading-5" - ) %> +
+ +
+ <%= text_input(@form, :buzzer, + phx_change: "change", + phx_target: @myself, + class: + "block w-full px-3 py-2 placeholder-gray-400 transition duration-150 ease-in-out border border-gray-300 rounded-md appearance-none focus:outline-none focus:ring-blue focus:border-blue-300 sm:text-sm sm:leading-5" + ) %> +
diff --git a/lib/bike_brigade_web/core_components.ex b/lib/bike_brigade_web/core_components.ex index 6bd6bae7..a60e122b 100644 --- a/lib/bike_brigade_web/core_components.ex +++ b/lib/bike_brigade_web/core_components.ex @@ -718,7 +718,7 @@ defmodule BikeBrigadeWeb.CoreComponents do phx-window-keydown={hide_modal(@on_cancel, @id)} phx-key="escape" phx-click-away={hide_modal(@on_cancel, @id)} - class="relative hidden transition bg-white shadow-lg rounded-2xl p-14 shadow-zinc-700/10 ring-1 ring-zinc-700/10" + class="relative hidden transition bg-white shadow-lg rounded-2xl p-6 md:p-14 shadow-zinc-700/10 ring-1 ring-zinc-700/10" >