diff --git a/assets/css/app.css b/assets/css/app.css index 1feb872..39db93a 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -69,3 +69,13 @@ footer { align-items: center; gap: 8px; } + +.navbar { + display: flex; + gap: 16px; + padding-top: 16px; +} + +.navbar .space { + flex-grow: 1; +} diff --git a/lib/comfycamp_web.ex b/lib/comfycamp_web.ex index 4cb7922..61f4c25 100644 --- a/lib/comfycamp_web.ex +++ b/lib/comfycamp_web.ex @@ -88,6 +88,7 @@ defmodule ComfycampWeb do import ComfycampWeb.CoreComponents import ComfycampWeb.Flash import ComfycampWeb.Gettext + import ComfycampWeb.NavBar # Shortcut for generating JS commands alias Phoenix.LiveView.JS diff --git a/lib/comfycamp_web/components/layouts/app.html.heex b/lib/comfycamp_web/components/layouts/app.html.heex index b411e73..a7040b8 100644 --- a/lib/comfycamp_web/components/layouts/app.html.heex +++ b/lib/comfycamp_web/components/layouts/app.html.heex @@ -1,10 +1,4 @@ -
-
- Главная - Сервисы - Кинотеатр -
-
+<.navbar current_user={@current_user} /> <.flash_group flash={@flash} /> diff --git a/lib/comfycamp_web/components/layouts/root.html.heex b/lib/comfycamp_web/components/layouts/root.html.heex index 4cb6b94..e0fcc7f 100644 --- a/lib/comfycamp_web/components/layouts/root.html.heex +++ b/lib/comfycamp_web/components/layouts/root.html.heex @@ -31,47 +31,6 @@ - <%= @inner_content %> diff --git a/lib/comfycamp_web/components/navbar.ex b/lib/comfycamp_web/components/navbar.ex new file mode 100644 index 0000000..8fac3cd --- /dev/null +++ b/lib/comfycamp_web/components/navbar.ex @@ -0,0 +1,44 @@ +defmodule ComfycampWeb.NavBar do + use Phoenix.Component + + alias Comfycamp.Accounts.User + + @doc """ + Navigation bar. + + ## Examples + + <.navbar current_user={@current_user} /> + """ + attr :current_user, User, required: false + + def navbar(assigns) do + ~H""" + + """ + end +end