rename project from SimpleshopTheme to Berrypod
All modules, configs, paths, and references updated. 836 tests pass, zero warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
lib/berrypod_web/admin_layout_hook.ex
Normal file
19
lib/berrypod_web/admin_layout_hook.ex
Normal file
@@ -0,0 +1,19 @@
|
||||
defmodule BerrypodWeb.AdminLayoutHook do
|
||||
@moduledoc """
|
||||
LiveView on_mount hook that assigns the current path for admin sidebar navigation.
|
||||
"""
|
||||
import Phoenix.Component
|
||||
|
||||
def on_mount(:assign_current_path, _params, _session, socket) do
|
||||
socket =
|
||||
socket
|
||||
|> assign(:current_path, "")
|
||||
|> Phoenix.LiveView.attach_hook(:set_current_path, :handle_params, fn _params,
|
||||
uri,
|
||||
socket ->
|
||||
{:cont, assign(socket, :current_path, URI.parse(uri).path)}
|
||||
end)
|
||||
|
||||
{:cont, socket}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user