postland/lib/postland_web/components/layouts.ex

26 lines
638 B
Elixir
Raw Normal View History

2024-09-20 19:30:46 +00:00
defmodule PostlandWeb.Layouts do
use PostlandWeb, :html
embed_templates "layouts/*"
2024-11-03 01:46:15 +00:00
def nav_link(assigns) do
~H"""
<li>
<!-- Current: "bg-gray-50 text-violet-600", Default: "text-gray-700 hover:text-violet-600 hover:bg-gray-50" -->
<a
href={@href}
class={[
"group flex gap-x-3 rounded-lg p-2 pl-3 text-sm/6 font-semibold",
if(assigns[:active],
do: "bg-gray-50 text-violet-600",
else: "text-gray-700 hover:text-violet-600 hover:bg-gray-50"
)
]}
>
<%= render_slot(@inner_block) %>
</a>
</li>
"""
end
2024-09-20 19:30:46 +00:00
end