fix(portal): Polish link in peeks (#7180)

This commit is contained in:
Andrew Dryga
2024-10-29 19:22:20 -06:00
committed by GitHub
parent 7037830b19
commit a67c12de7e
4 changed files with 29 additions and 8 deletions

View File

@@ -102,7 +102,8 @@ defmodule Web.Actors.Index do
navigate={~p"/#{@account}/actors/#{actor}?#groups"}
class={[
"hover:underline hover:decoration-line",
"underline underline-offset-2 decoration-1 decoration-dotted"
"underline underline-offset-2 decoration-1 decoration-dotted",
link_style()
]}
>
<%= @actor_groups[actor.id].count %>
@@ -137,19 +138,26 @@ defmodule Web.Actors.Index do
</:empty>
<:item :let={client}>
<div class="mr-2">
<.link navigate={~p"/#{@account}/clients/#{client}"} class="mr-2">
<.client_as_icon client={client} />
<div class="relative">
<div class="absolute -inset-y-2.5 -right-1">
<.online_icon schema={client} />
</div>
</div>
</div>
</.link>
</:item>
<:tail :let={count}>
<span class={["inline-block whitespace-nowrap"]}>
and <%= count %> more.
<span class="inline-block whitespace-nowrap flex">
<span>and</span>
<.link
navigate={~p"/#{@account}/actors/#{actor}?#clients"}
class={["inline-flex ml-1", link_style()]}
>
<%= count %> more
</.link>
<span>.</span>
</span>
</:tail>
</.peek>

View File

@@ -38,6 +38,12 @@ defmodule Web.Clients.Components do
<:content>
<div>
<%= @client.name %>
<.icon
:if={not is_nil(@client.verified_at)}
name="hero-shield-check"
class="h-2.5 w-2.5 text-neutral-500"
title="Device attributes of this client are manually verified"
/>
</div>
<div>
<.client_os_name_and_version client={@client} />

View File

@@ -97,8 +97,15 @@ defmodule Web.Groups.Index do
</:item>
<:tail :let={count}>
<span class="pl-1">
and <%= count %> more.
<span class="inline-block whitespace-nowrap flex ml-1">
<span>and</span>
<.link
navigate={~p"/#{@account}/groups/#{group}?#actors"}
class={["inline-flex ml-1", link_style()]}
>
<%= count %> more
</.link>
<span>.</span>
</span>
</:tail>
</.peek>

View File

@@ -145,7 +145,7 @@ defmodule Web.Live.Groups.IndexTest do
all_names = Enum.map(actors, & &1.name)
assert Enum.all?(peeked_names, &(&1 in all_names))
assert tail == "7 more."
assert tail =~ "7 more"
assert around_now?(row["created"])
end)