Skip to content

Commit eab5b69

Browse files
authored
Prefer Single List Layout (#369)
1 parent c580585 commit eab5b69

File tree

2 files changed

+40
-28
lines changed

2 files changed

+40
-28
lines changed

lib/plexus_web/components/core_components.ex

+29-23
Original file line numberDiff line numberDiff line change
@@ -638,46 +638,52 @@ defmodule PlexusWeb.CoreComponents do
638638
)
639639

640640
~H"""
641-
<div class="flex drop-shadow-sm hover:drop-shadow-md">
642-
<div class="aspect-h-1 aspect-w-1 w-20 h-20 bg-white overflow-hidden">
641+
<div class="flex">
642+
<div class="aspect-h-1 aspect-w-1 w-24 h-24 bg-white overflow-hidden">
643643
<img
644644
src={@app.icon_url}
645645
alt={@app.name <> " Icon"}
646646
class="h-full w-full object-cover object-center"
647647
/>
648648
</div>
649649
<div class="flex-1 flex items-center justify-between bg-white truncate">
650-
<div class="flex-1 px-4 py-2 text-sm leading-5 truncate">
651-
<div class="truncate text-gray-900 font-medium transition ease-in-out duration-150">
650+
<div class="flex-1 px-4 py-2 text-md leading-5 truncate">
651+
<div class="truncate text-gray-900 font-semibold transition ease-in-out duration-150">
652652
<%= @app.name %>
653653
</div>
654-
<p :if={@total_counts == 1} class="text-gray-500 truncate">
654+
<p :if={@total_counts == 1} class="text-gray-600 truncate">
655655
<%= @total_counts %> Rating
656656
</p>
657-
<p :if={@total_counts != 1} class="text-gray-500 truncate">
657+
<p :if={@total_counts != 1} class="text-gray-600 truncate">
658658
<%= @total_counts %> Ratings
659659
</p>
660660
</div>
661661
</div>
662-
<div class="flex flex-col justify-between">
663-
<div class={[
664-
"flex-1 flex items-center justify-center w-16 text-white text-sm leading-5 font-medium",
665-
@native_level == :unrated && "bg-gray-700",
666-
@native_level == :borked && "bg-red-800",
667-
@native_level == :bronze && "bg-amber-800",
668-
@native_level == :silver && "bg-slate-300 text-black",
669-
@native_level == :gold && "bg-amber-200 black"
670-
]}>
662+
<div class="flex flex-col justify-between bg-white">
663+
<div
664+
title="DeGoogled Score"
665+
class={[
666+
"flex flex-1 items-center justify-center w-24 text-white text-sm leading-5 font-medium",
667+
@native_level == :unrated && "bg-gray-700",
668+
@native_level == :borked && "bg-red-800",
669+
@native_level == :bronze && "bg-amber-800",
670+
@native_level == :silver && "bg-slate-300 text-black",
671+
@native_level == :gold && "bg-amber-200 black"
672+
]}
673+
>
671674
<%= @app.scores.native.numerator %>
672675
</div>
673-
<div class={[
674-
"flex-1 flex items-center justify-center w-16 text-white text-sm leading-5 font-medium",
675-
@micro_g_level == :unrated && "bg-gray-700",
676-
@micro_g_level == :borked && "bg-red-800",
677-
@micro_g_level == :bronze && "bg-amber-800",
678-
@micro_g_level == :silver && "bg-slate-300 text-black",
679-
@micro_g_level == :gold && "bg-amber-200 text-black"
680-
]}>
676+
<div
677+
title="MicroG Score"
678+
class={[
679+
"flex flex-1 items-center justify-center w-24 text-white text-sm leading-5 font-medium",
680+
@micro_g_level == :unrated && "bg-gray-700",
681+
@micro_g_level == :borked && "bg-red-800",
682+
@micro_g_level == :bronze && "bg-amber-800",
683+
@micro_g_level == :silver && "bg-slate-300 text-black",
684+
@micro_g_level == :gold && "bg-amber-200 text-black"
685+
]}
686+
>
681687
&mu;<%= @app.scores.micro_g.numerator %>
682688
</div>
683689
</div>

lib/plexus_web/live/app_live/index.html.heex

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
<.header>
1+
<.header class="max-w-3xl mx-auto">
22
Apps (<%= @total_entries %> entries)
33
</.header>
44

5-
<.simple_form for={@form} id="search-form" phx-change="search" phx-submit="search">
5+
<.simple_form
6+
class="max-w-3xl mx-auto"
7+
for={@form}
8+
id="search-form"
9+
phx-change="search"
10+
phx-submit="search"
11+
>
612
<.focus_wrap id="focus-first-search">
713
<.input field={@form[:search]} label="Search" phx-debounce="300" />
814
</.focus_wrap>
@@ -15,7 +21,7 @@
1521
phx-viewport-bottom={!@end_of_timeline? && "next-page"}
1622
phx-page-loading
1723
class={[
18-
"mt-1 grid grid-cols-1 gap-4 sm:gap-5 sm:grid-cols-2 lg:grid-cols-3",
24+
"max-w-3xl mx-auto mt-1 grid grid-cols-1 gap-4",
1925
if(@end_of_timeline?, do: "pb-10", else: "pb-[calc(200vh)]"),
2026
if(@page == 1, do: "pt-10", else: "pt-[calc(200vh)]")
2127
]}
@@ -26,9 +32,9 @@
2632
</ul>
2733

2834
<div :if={@no_results?} class="mt-5 text-[50px] text-center">
29-
No apps found<br />😭
35+
No Results
3036
</div>
3137

3238
<div :if={@end_of_timeline? and not @no_results?} class="mt-5 text-[50px] text-center">
33-
End of list<br />🤭
39+
End of List
3440
</div>

0 commit comments

Comments
 (0)