Use link+navigate instead of a+href
Makes application more performant as it avoids re-establishing a connection.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user