Skip to content

Commit 6ed444d

Browse files
chore: improve responsive design
1 parent 6c941fc commit 6ed444d

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

lib/atomic_web/components/modal.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ defmodule AtomicWeb.Components.Modal do
4040
<div class="fixed inset-0 overflow-y-auto" aria-labelledby={"#{@id}-title"} aria-describedby={"#{@id}-description"} role="dialog" aria-modal="true" tabindex="0">
4141
<div class="flex min-h-full items-center justify-center">
4242
<div class={"#{@class} w-full max-w-3xl p-4 sm:p-6 lg:py-8"}>
43-
<.focus_wrap id={"#{@id}-container"} phx-click-away={JS.exec("phx-cancel", to: "##{@id}")} class="shadow-zinc-700/10 ring-zinc-700/10 relative hidden rounded-2xl bg-white p-14 shadow-lg ring-1 transition">
43+
<.focus_wrap id={"#{@id}-container"} phx-click-away={JS.exec("phx-cancel", to: "##{@id}")} class="shadow-zinc-700/10 ring-zinc-700/10 relative hidden rounded-2xl bg-white px-6 py-14 sm:px-8 md:px-14 shadow-lg ring-1 transition">
4444
<div class="absolute top-6 right-5">
4545
<button phx-click={JS.exec("phx-cancel", to: "##{@id}")} type="button" class="-m-3 flex-none p-3 opacity-20 outline-none hover:opacity-40" aria-label={gettext("close")}>
4646
<.icon name="hero-x-mark-solid" class="size-5" />

lib/atomic_web/components/tabs.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ defmodule AtomicWeb.Components.Tabs do
8585
underline_classes =
8686
if active,
8787
do: "bg-orange-100 text-orange-600",
88-
else: "text-zinc-300 bg-zinc-100"
88+
else: "text-white bg-zinc-100"
8989

9090
[base_classes, active_classes, underline_classes]
9191
end

lib/atomic_web/live/activity_live/form_component.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ defmodule AtomicWeb.ActivityLive.FormComponent do
3232
@impl true
3333
def handle_event("validate", %{"activity" => activity_params}, socket) do
3434
description = Map.get(activity_params, "description", "")
35-
capacity = Map.get(activity_params, "max_entries", "")
35+
capacity = Map.get(activity_params, "maximum_entries", "")
3636
has_description = is_nil(description) || String.trim(description) == ""
37-
has_capacity = is_nil(capacity) || String.trim(capacity) == ""
37+
capacity_field_empty = is_nil(capacity) || String.trim(capacity) == ""
3838

3939
changeset =
4040
socket.assigns.activity
@@ -44,7 +44,7 @@ defmodule AtomicWeb.ActivityLive.FormComponent do
4444
{:noreply,
4545
socket
4646
|> assign(:has_description?, not has_description)
47-
|> assign(:has_max_capacity?, has_capacity)
47+
|> assign(:has_max_capacity?, not capacity_field_empty)
4848
|> assign_form(changeset)}
4949
end
5050

lib/atomic_web/live/activity_live/form_component.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<div class="mt-3 sm:mt-4 flex flex-col gap-y-1">
7878
<.field class="atomic-button atomic-button--primary-outline text-gray-900" type="text" field={fl[:name]} label="Location" placeholder="Choose location name" required />
7979
</div>
80-
<div class="-mt-2 sm:-mt-2 md:mt-4 flex flex-col gap-y-1 sm:mt-0 md:ml-8">
80+
<div class="-mt-2 sm:-mt-2 md:mt-4 flex flex-col gap-y-1 md:ml-8">
8181
<.field class="atomic-button atomic-button--primary-outline text-gray-900" type="text" field={fl[:address]} label="Address" placeholder="Address" required />
8282
</div>
8383
</.inputs_for>
@@ -121,7 +121,7 @@
121121

122122
<div class="mt-4 flex-grow">
123123
<div class="flex justify-center lg:justify-end">
124-
<.button class="w-full p-5 lg:p-3" type="submit" phx-disable-with="Saving...">
124+
<.button class="w-full p-4 lg:p-3" type="submit" phx-disable-with="Saving...">
125125
<%= if @action == :new do %>
126126
<span><%= gettext("Create Activity") %></span>
127127
<% else %>

lib/atomic_web/live/activity_live/show.html.heex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
</p>
8383
</div>
8484
<% end %>
85-
<!-- TODO: Support for multi-day activities -->
8685
</div>
8786
<% end %>
8887
<!-- Capacity -->
@@ -268,14 +267,17 @@
268267
<.modal :if={@participants_modal} show id="participants_modal" on_cancel={JS.push("handle_participants_modal")}>
269268
<span class="flex-l text-lg font-semibold text-gray-900">Participants</span>
270269
<%= if length(@participants) != 0 do %>
271-
<div class="align-center mt-2 flex w-full flex-wrap place-items-center gap-4">
270+
<div class="flex justify-center place-items-center w-full">
271+
<div class="align-center mt-4 grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 w-fit">
272272
<%= for participant <- @participants do %>
273-
<div class="flex h-6 items-center px-0 py-6">
273+
<div class="flex h-10">
274274
<.avatar size={:xs} name={participant.name} type={:user} />
275275
<.link navigate={~p"/profile/#{participant.slug}"} class="ml-4 hover:underline"><%= participant.name %></.link>
276276
</div>
277277
<% end %>
278278
</div>
279+
</div>
280+
279281
<% else %>
280282
<div class="mt-4">
281283
<span>There are no participants for this activity</span>

0 commit comments

Comments
 (0)