Consolidate Fluxon button usage via CoreComponents
This commit is contained in:
@@ -48,14 +48,14 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="mt-4 flex justify-center">
|
<div class="mt-4 flex justify-center">
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
variant="solid"
|
variant="solid"
|
||||||
disabled={length(@scan_results) == 0}
|
disabled={length(@scan_results) == 0}
|
||||||
phx-disable-with={gettext("Adding...")}
|
phx-disable-with={gettext("Adding...")}
|
||||||
phx-click={JS.push("import_releases", target: "#barcode-scanner")}
|
phx-click={JS.push("import_releases", target: "#barcode-scanner")}
|
||||||
>
|
>
|
||||||
{gettext("Add releases")}
|
{gettext("Add releases")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ defmodule MusicLibraryWeb.CoreComponents do
|
|||||||
alias Phoenix.LiveView.JS
|
alias Phoenix.LiveView.JS
|
||||||
use Gettext, backend: MusicLibraryWeb.Gettext
|
use Gettext, backend: MusicLibraryWeb.Gettext
|
||||||
|
|
||||||
|
defdelegate button(assigns), to: Fluxon.Components.Button
|
||||||
defdelegate date_time_picker(assigns), to: Fluxon.Components.DatePicker
|
defdelegate date_time_picker(assigns), to: Fluxon.Components.DatePicker
|
||||||
defdelegate input(assigns), to: Fluxon.Components.Input
|
defdelegate input(assigns), to: Fluxon.Components.Input
|
||||||
defdelegate loading(assigns), to: Fluxon.Components.Loading
|
defdelegate loading(assigns), to: Fluxon.Components.Loading
|
||||||
|
|||||||
@@ -114,13 +114,9 @@ defmodule MusicLibraryWeb.FormComponent do
|
|||||||
</div>
|
</div>
|
||||||
<:actions>
|
<:actions>
|
||||||
<div class="w-full md:flex md:justify-center">
|
<div class="w-full md:flex md:justify-center">
|
||||||
<Fluxon.Components.Button.button
|
<.button variant="solid" class="w-full md:w-auto" phx-disable-with={gettext("Saving...")}>
|
||||||
variant="solid"
|
|
||||||
class="w-full md:w-auto"
|
|
||||||
phx-disable-with={gettext("Saving...")}
|
|
||||||
>
|
|
||||||
{gettext("Save")}
|
{gettext("Save")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</div>
|
</div>
|
||||||
</:actions>
|
</:actions>
|
||||||
</.simple_form>
|
</.simple_form>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ defmodule MusicLibraryWeb.ReleaseComponent do
|
|||||||
<.sheet :if={@record.selected_release_id} id={@sheet_id} placement="right">
|
<.sheet :if={@record.selected_release_id} id={@sheet_id} placement="right">
|
||||||
<div class="mt-6 flex justify-between items-center gap-4">
|
<div class="mt-6 flex justify-between items-center gap-4">
|
||||||
<h3 class="text-lg font-semibold text-zinc-700 dark:text-zinc-300">{gettext("Tracks")}</h3>
|
<h3 class="text-lg font-semibold text-zinc-700 dark:text-zinc-300">{gettext("Tracks")}</h3>
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
:if={@can_scrobble?}
|
:if={@can_scrobble?}
|
||||||
size="sm"
|
size="sm"
|
||||||
phx-click="scrobble_release"
|
phx-click="scrobble_release"
|
||||||
@@ -45,15 +45,10 @@ defmodule MusicLibraryWeb.ReleaseComponent do
|
|||||||
phx-disable-with={gettext("Scrobbling...")}
|
phx-disable-with={gettext("Scrobbling...")}
|
||||||
>
|
>
|
||||||
{gettext("Scrobble release")}
|
{gettext("Scrobble release")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
<Fluxon.Components.Button.button
|
<.button :if={!@can_scrobble?} as="link" size="sm" href={LastFm.auth_url()}>
|
||||||
:if={!@can_scrobble?}
|
|
||||||
as="link"
|
|
||||||
size="sm"
|
|
||||||
href={LastFm.auth_url()}
|
|
||||||
>
|
|
||||||
{gettext("Connect your Last.fm account")}
|
{gettext("Connect your Last.fm account")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :if={@release_with_tracks} class="space-y-4 mt-4">
|
<div :if={@release_with_tracks} class="space-y-4 mt-4">
|
||||||
@@ -81,7 +76,7 @@ defmodule MusicLibraryWeb.ReleaseComponent do
|
|||||||
<h4 class="text-sm md:text-md font-semibold text-zinc-700 dark:text-zinc-300">
|
<h4 class="text-sm md:text-md font-semibold text-zinc-700 dark:text-zinc-300">
|
||||||
{medium_title(medium)}
|
{medium_title(medium)}
|
||||||
</h4>
|
</h4>
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
:if={@can_scrobble?}
|
:if={@can_scrobble?}
|
||||||
size="sm"
|
size="sm"
|
||||||
phx-click="scrobble_medium"
|
phx-click="scrobble_medium"
|
||||||
@@ -90,7 +85,7 @@ defmodule MusicLibraryWeb.ReleaseComponent do
|
|||||||
phx-disable-with={gettext("Scrobbling...")}
|
phx-disable-with={gettext("Scrobbling...")}
|
||||||
>
|
>
|
||||||
{gettext("Scrobble disc")}
|
{gettext("Scrobble disc")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</div>
|
</div>
|
||||||
<ul id={"disc-#{medium.number}"} class="w-full table table-auto">
|
<ul id={"disc-#{medium.number}"} class="w-full table table-auto">
|
||||||
<li
|
<li
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="flex items-center justify-between gap-6 mb-2 mt-2">
|
<div class="flex items-center justify-between gap-6 mb-2 mt-2">
|
||||||
<.search_form query={@record_list_params.query} />
|
<.search_form query={@record_list_params.query} />
|
||||||
<nav class="isolate inline-flex rounded-md shadow-xs">
|
<nav class="isolate inline-flex rounded-md shadow-xs">
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
class="rounded-l-md rounded-r-none"
|
class="rounded-l-md rounded-r-none"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
as="link"
|
as="link"
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
>
|
>
|
||||||
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
|
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
|
||||||
{gettext("Add")}
|
{gettext("Add")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
class="-ml-px rounded-r-md rounded-l-none"
|
class="-ml-px rounded-r-md rounded-l-none"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
as="link"
|
as="link"
|
||||||
@@ -22,14 +22,14 @@
|
|||||||
>
|
>
|
||||||
<.barcode_icon class="mr-2 fill-current" />
|
<.barcode_icon class="mr-2 fill-current" />
|
||||||
{gettext("Scan")}
|
{gettext("Scan")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="flex items-end justify-between gap-6 mt-8">
|
<div class="flex items-end justify-between gap-6 mt-8">
|
||||||
<span class="isolate inline-flex rounded-md shadow-xs">
|
<span class="isolate inline-flex rounded-md shadow-xs">
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
patch={order_path(@record_list_params, :purchase)}
|
patch={order_path(@record_list_params, :purchase)}
|
||||||
as="link"
|
as="link"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
data-slot="icon"
|
data-slot="icon"
|
||||||
/>
|
/>
|
||||||
{gettext("Purchase")}
|
{gettext("Purchase")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
<Fluxon.Components.Button.button
|
<.button
|
||||||
patch={order_path(@record_list_params, :alphabetical)}
|
patch={order_path(@record_list_params, :alphabetical)}
|
||||||
as="link"
|
as="link"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
>
|
>
|
||||||
<.icon name="hero-user-solid" class="mr-1 h-4 w-4" aria-hidden="true" data-slot="icon" />
|
<.icon name="hero-user-solid" class="mr-1 h-4 w-4" aria-hidden="true" data-slot="icon" />
|
||||||
{gettext("A->Z")}
|
{gettext("A->Z")}
|
||||||
</Fluxon.Components.Button.button>
|
</.button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p class="text-right text-sm max-sm:text-xs text-zinc-900 dark:text-zinc-400">
|
<p class="text-right text-sm max-sm:text-xs text-zinc-900 dark:text-zinc-400">
|
||||||
|
|||||||
Reference in New Issue
Block a user