Use link+navigate instead of a+href

Makes application more performant as it avoids re-establishing a
connection.
This commit is contained in:
Claudio Ortolina
2024-12-24 14:42:58 +00:00
parent e7a8a2c019
commit 2571d1dfd3
2 changed files with 9 additions and 9 deletions
@@ -55,12 +55,12 @@ defmodule MusicLibraryWeb.StatsLive.DataComponents do
</p>
</dt>
<dd class="mt-1">
<a
href={@path}
<.link
navigate={@path}
class="block text-2xl sm:text-3xl font-semibold text-center text-zinc-900 hover:text-zinc-500 dark:text-zinc-300 dark:hover:text-zinc-200"
>
{@count}
</a>
</.link>
</dd>
</div>
"""
@@ -32,12 +32,12 @@
{Record.format_long_label(format)}
</dt>
<dd class="mt-1 text-center">
<a
<.link
class="text-xl lg:text-2xl font-semibold hover:text-zinc-500 dark:text-zinc-300 dark:hover:text-zinc-200"
href={~p"/collection?query=format:#{format}"}
navigate={~p"/collection?query=format:#{format}"}
>
{count}
</a>
</.link>
</dd>
</div>
</dl>
@@ -57,12 +57,12 @@
{Record.type_long_label(type)}
</dt>
<dd class="mt-1 text-center">
<a
<.link
class="text-xl lg:text-2xl font-semibold hover:text-zinc-500 dark:text-zinc-300 dark:hover:text-zinc-200"
href={~p"/collection?query=type:#{type}"}
navigate={~p"/collection?query=type:#{type}"}
>
{count}
</a>
</.link>
</dd>
</div>
</dl>