From 9851a5c6bf218271fa8ff5ceec1d22eafe7117cb Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 20 Apr 2026 15:46:40 +0100 Subject: [PATCH] Use cart with barcode scanner --- .../components/barcode_scanner.ex | 326 +++++++++++++----- .../live/collection_live/index.ex | 1 + priv/gettext/default.pot | 28 +- priv/gettext/en/LC_MESSAGES/default.po | 28 +- .../live/collection_live/index_test.exs | 4 +- 5 files changed, 280 insertions(+), 107 deletions(-) diff --git a/lib/music_library_web/components/barcode_scanner.ex b/lib/music_library_web/components/barcode_scanner.ex index dbf9df50..bb22667b 100644 --- a/lib/music_library_web/components/barcode_scanner.ex +++ b/lib/music_library_web/components/barcode_scanner.ex @@ -14,49 +14,134 @@ defmodule MusicLibraryWeb.Components.BarcodeScanner do {:ok, socket |> assign(:camera, :pending) - |> assign(:scan_results, [])} + |> assign(:scan_results, []) + |> assign(:cart_expanded?, true)} end @impl true def render(assigns) do ~H""" -
-
-

- {gettext("Scan one or more barcodes")} -

-
-
- <.camera_button camera={@camera} /> -
+
+
+
+
+

+ {gettext("Scan one or more barcodes")} +

+
+
+ <.camera_button camera={@camera} /> +
+
-
    -
  • - <.scan_result scan_result={scan_result} /> -
  • -
+