Skip to content

Commit

Permalink
differentiate custom lists from other links in main menu #145 #424
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Nov 1, 2023
1 parent 8a785e3 commit cbd558d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/app_web/controllers/auth_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/app_web/templates/layout/live.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= render(AppWeb.NavView, "nav.html", assigns) %>
<.live_component module={AppWeb.Nav} id="menu" {assigns} />
<%= @inner_content %>
18 changes: 16 additions & 2 deletions lib/app_web/templates/nav/nav.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,32 @@
<%= for list <- @lists do %>
<div class="space-y-1 px-2 pb-3 pt-2 text-right">
<a
class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium"
class="text-white bg-gray-700 hover:bg-gray-600 rounded-md px-3 py-2 text-sm font-medium"
href={list_url(list.cid)}
>
<%= list_name(list.name) %>
</a>
</div>
<% end %>
<div class="space-y-1 px-2 pb-3 pt-2 text-right">
<%= link("🗄 Lists",
to: "/lists",
class:
"text-gray-900 bg-white hover:bg-gray-200 rounded-md px-3 py-2 text-sm font-medium"
) %>
</div>
<div class="space-y-1 px-2 pb-3 pt-2 text-right">
<%= link("📈 Stats",
to: "/stats",
class:
"text-gray-900 bg-white hover:bg-gray-200 rounded-md px-3 py-2 text-sm font-medium"
) %>
</div>
<div class="space-y-1 px-2 pb-3 pt-2 text-right">
<%= 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"
) %>
</div>
</div>
Expand Down

0 comments on commit cbd558d

Please sign in to comment.