fix preview background
This commit is contained in:
@@ -8,6 +8,10 @@ defmodule LabelmakerWeb.Home do
|
||||
assigns =
|
||||
Constants.defaults()
|
||||
|> Map.merge(Constants.preview())
|
||||
|> Map.put(
|
||||
:preview_background,
|
||||
Tools.process_preview_background(Constants.preview().preview_background)
|
||||
)
|
||||
|> Enum.to_list()
|
||||
|
||||
{
|
||||
@@ -32,15 +36,7 @@ defmodule LabelmakerWeb.Home do
|
||||
end
|
||||
|
||||
def handle_event("update_preview", %{"bg" => bg}, socket) do
|
||||
preview_background =
|
||||
case bg do
|
||||
"r" -> "bg-[linear-gradient(to_right,_black_33%,_white_67%)]"
|
||||
"b" -> "bg-[linear-gradient(to_bottom,_black_33%,_white_67%)]"
|
||||
"c" -> ""
|
||||
_ -> "bg-[linear-gradient(to_right,_black_33%,_white_67%)]"
|
||||
end
|
||||
|
||||
{:noreply, assign(socket, :preview_background, preview_background)}
|
||||
{:noreply, assign(socket, :preview_background, Tools.process_preview_background(bg))}
|
||||
end
|
||||
|
||||
def handle_event("update_alignment", %{"option" => option}, socket) do
|
||||
|
||||
Reference in New Issue
Block a user