Remove visible camera status text
This commit is contained in:
@@ -38,7 +38,6 @@ defmodule MusicLibraryWeb.RecordLive.BarcodeScannerComponent do
|
|||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div>
|
<div>
|
||||||
<p>{@camera}</p>
|
|
||||||
<button
|
<button
|
||||||
:if={!(@camera == :allowed)}
|
:if={!(@camera == :allowed)}
|
||||||
id="camera-button"
|
id="camera-button"
|
||||||
@@ -48,7 +47,7 @@ defmodule MusicLibraryWeb.RecordLive.BarcodeScannerComponent do
|
|||||||
|> JS.dispatch("camera_request", to: "#barcode-scanner")
|
|> JS.dispatch("camera_request", to: "#barcode-scanner")
|
||||||
|> JS.hide(to: "#camera-button")
|
|> JS.hide(to: "#camera-button")
|
||||||
}
|
}
|
||||||
class="relative block w-full h-96 rounded-lg border-2 border-dashed border-zinc-300 p-12 text-center hover:border-zinc-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
class="relative block w-full h-96 rounded-lg border-2 border-dashed border-zinc-300 p-12 text-center hover:border-zinc-400 focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="mx-auto size-12 text-zinc-400"
|
class="mx-auto size-12 text-zinc-400"
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
|||||||
conn
|
conn
|
||||||
|> visit(~p"/collection/scan")
|
|> visit(~p"/collection/scan")
|
||||||
|> assert_has("h1", text: "Scan one or more barcodes")
|
|> assert_has("h1", text: "Scan one or more barcodes")
|
||||||
|> assert_has("p", text: "pending")
|
|> assert_has("button#camera-button")
|
||||||
|
|
||||||
session
|
session
|
||||||
|> unwrap(fn view ->
|
|> unwrap(fn view ->
|
||||||
@@ -341,7 +341,17 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
|||||||
|> element("#barcode-scanner")
|
|> element("#barcode-scanner")
|
||||||
|> render_hook("camera_denied")
|
|> render_hook("camera_denied")
|
||||||
end)
|
end)
|
||||||
|> assert_has("p", text: "denied")
|
|> assert_has("button#camera-button")
|
||||||
|
|> refute_has("video#camera-preview")
|
||||||
|
|
||||||
|
session
|
||||||
|
|> unwrap(fn view ->
|
||||||
|
view
|
||||||
|
|> element("#barcode-scanner")
|
||||||
|
|> render_hook("camera_allowed")
|
||||||
|
end)
|
||||||
|
|> refute_has("button#camera-button")
|
||||||
|
|> assert_has("video#camera-preview")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user