chore: use verified routes in nav bar

This commit is contained in:
Ivan R. 2024-07-28 18:03:48 +05:00
parent 8040c38edf
commit 2d81bf20ce
Signed by: lumin
GPG key ID: E0937DC7CD6D3817

View file

@ -1,5 +1,6 @@
defmodule ComfycampWeb.NavBar do
use Phoenix.Component
use ComfycampWeb, :verified_routes
alias Comfycamp.Accounts.User
@ -15,26 +16,26 @@ defmodule ComfycampWeb.NavBar do
def navbar(assigns) do
~H"""
<nav class="limiter navbar">
<.link href="/">Главная</.link>
<.link href="/blog/">Блог</.link>
<.link href="/cinema/">Кинотеатр</.link>
<.link href={~p"/"}>Главная</.link>
<.link href={~p"/blog/"}>Блог</.link>
<.link href={~p"/cinema/"}>Кинотеатр</.link>
<div class="space" />
<%= if @current_user do %>
<.link href="/users/settings">
<.link href={~p"/users/settings"}>
Настройки
</.link>
<.link href="/users/log_out" method="delete">
<.link href={~p"/users/log_out"} method="delete">
Выйти
</.link>
<% else %>
<.link href="/users/register">
<.link href={~p"/users/register"}>
Зарегистрироваться
</.link>
<.link href="/users/log_in">
<.link href={~p"/users/log_in"}>
Войти
</.link>
<% end %>