From 65bb26cdac92fa604b9d5abc053403d0babd7db4 Mon Sep 17 00:00:00 2001 From: Tom Konidas Date: Tue, 8 Oct 2024 19:04:23 -0400 Subject: [PATCH] Single list layout --- lib/plexus_web/components/core_components.ex | 52 +++++++++++--------- lib/plexus_web/live/app_live/index.html.heex | 16 ++++-- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/lib/plexus_web/components/core_components.ex b/lib/plexus_web/components/core_components.ex index 19439616..7d522fb3 100644 --- a/lib/plexus_web/components/core_components.ex +++ b/lib/plexus_web/components/core_components.ex @@ -638,8 +638,8 @@ defmodule PlexusWeb.CoreComponents do ) ~H""" -
-
+
+
{@app.name " Icon"} @@ -647,37 +647,43 @@ defmodule PlexusWeb.CoreComponents do />
-
-
+
+
<%= @app.name %>
-

+

<%= @total_counts %> Rating

-

+

<%= @total_counts %> Ratings

-
-
+
+
<%= @app.scores.native.numerator %>
-
+
μ<%= @app.scores.micro_g.numerator %>
diff --git a/lib/plexus_web/live/app_live/index.html.heex b/lib/plexus_web/live/app_live/index.html.heex index 679ba3d3..4c1c9170 100644 --- a/lib/plexus_web/live/app_live/index.html.heex +++ b/lib/plexus_web/live/app_live/index.html.heex @@ -1,8 +1,14 @@ -<.header> +<.header class="max-w-3xl mx-auto"> Apps (<%= @total_entries %> entries) -<.simple_form for={@form} id="search-form" phx-change="search" phx-submit="search"> +<.simple_form + class="max-w-3xl mx-auto" + for={@form} + id="search-form" + phx-change="search" + phx-submit="search" +> <.focus_wrap id="focus-first-search"> <.input field={@form[:search]} label="Search" phx-debounce="300" /> @@ -15,7 +21,7 @@ phx-viewport-bottom={!@end_of_timeline? && "next-page"} phx-page-loading class={[ - "mt-1 grid grid-cols-1 gap-4 sm:gap-5 sm:grid-cols-2 lg:grid-cols-3", + "max-w-3xl mx-auto mt-1 grid grid-cols-1 gap-4", if(@end_of_timeline?, do: "pb-10", else: "pb-[calc(200vh)]"), if(@page == 1, do: "pt-10", else: "pt-[calc(200vh)]") ]} @@ -26,9 +32,9 @@
- No apps found
😭 + No Results
- End of list
🤭 + End of List