From cbd558dd964c6cb0d94583e1eb8b035ce0f90245 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Wed, 1 Nov 2023 14:58:02 +0000 Subject: [PATCH] differentiate custom lists from other links in main menu #145 #424 --- lib/app_web/controllers/auth_controller.ex | 1 + lib/app_web/templates/layout/live.html.heex | 2 +- lib/app_web/templates/nav/nav.html.heex | 18 ++++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/app_web/controllers/auth_controller.ex b/lib/app_web/controllers/auth_controller.ex index 2a750f44..898a3910 100644 --- a/lib/app_web/controllers/auth_controller.ex +++ b/lib/app_web/controllers/auth_controller.ex @@ -3,6 +3,7 @@ defmodule AppWeb.AuthController do import Phoenix.Component, only: [assign_new: 3] def on_mount(:default, _params, %{"jwt" => jwt} = _session, socket) do + dbg(jwt) {:cont, AuthPlug.assign_jwt_to_socket(socket, &Phoenix.Component.assign_new/3, jwt)} end diff --git a/lib/app_web/templates/layout/live.html.heex b/lib/app_web/templates/layout/live.html.heex index 3c68ea52..74a86392 100644 --- a/lib/app_web/templates/layout/live.html.heex +++ b/lib/app_web/templates/layout/live.html.heex @@ -1,2 +1,2 @@ -<%= render(AppWeb.NavView, "nav.html", assigns) %> +<.live_component module={AppWeb.Nav} id="menu" {assigns} /> <%= @inner_content %> diff --git a/lib/app_web/templates/nav/nav.html.heex b/lib/app_web/templates/nav/nav.html.heex index bdab7f87..cc6f8ae7 100644 --- a/lib/app_web/templates/nav/nav.html.heex +++ b/lib/app_web/templates/nav/nav.html.heex @@ -118,18 +118,32 @@ <%= for list <- @lists do %>
<%= list_name(list.name) %>
<% end %> +
+ <%= link("🗄 Lists", + to: "/lists", + class: + "text-gray-900 bg-white hover:bg-gray-200 rounded-md px-3 py-2 text-sm font-medium" + ) %> +
+
+ <%= link("📈 Stats", + to: "/stats", + class: + "text-gray-900 bg-white hover:bg-gray-200 rounded-md px-3 py-2 text-sm font-medium" + ) %> +
<%= link("🏷️ Tags", to: "/tags", class: - "text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium" + "text-gray-900 bg-white hover:bg-gray-200 rounded-md px-3 py-2 text-sm font-medium" ) %>