diff --git a/assets/css/app.css b/assets/css/app.css index 4d06503..933fef4 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -140,7 +140,7 @@ .footnote:before { content: '{'; } .footnote:after { content: '}'; } - body > header nav a { + a.button { @apply inline-block text-theme-base px-3 py-2.5 border border-theme-background1 hover:bg-theme-background1 rounded transition font-semibold; } } \ No newline at end of file diff --git a/lib/chiya_web/components/core_components.ex b/lib/chiya_web/components/core_components.ex index 0f97b11..50465db 100644 --- a/lib/chiya_web/components/core_components.ex +++ b/lib/chiya_web/components/core_components.ex @@ -30,9 +30,10 @@ defmodule ChiyaWeb.CoreComponents do """ end + attr :class, :string, default: nil def darkmode_toggle(assigns) do ~H""" - <.link href="#" id="dark-mode-toggle" class="text-sm leading-6"> + <.link href="#" id="dark-mode-toggle" class={["text-sm leading-6", @class]}> 🌙 ☀️ diff --git a/lib/chiya_web/components/layouts/root_public.html.heex b/lib/chiya_web/components/layouts/root_public.html.heex index 89da245..517df70 100644 --- a/lib/chiya_web/components/layouts/root_public.html.heex +++ b/lib/chiya_web/components/layouts/root_public.html.heex @@ -42,30 +42,30 @@ - + <.icon name="hero-home" /> Home - + <.icon name="hero-face-smile" /> About - + <.icon name="hero-paper-clip" /> Wiki <%= if @current_user do %> - + <.icon name="hero-beaker" /> Admin <% end %> - <.darkmode_toggle /> + <.darkmode_toggle class="button" /> diff --git a/lib/chiya_web/controllers/page_html/home.html.heex b/lib/chiya_web/controllers/page_html/home.html.heex index b83ccc8..0f57a06 100644 --- a/lib/chiya_web/controllers/page_html/home.html.heex +++ b/lib/chiya_web/controllers/page_html/home.html.heex @@ -7,19 +7,13 @@ - + <.icon name="hero-megaphone" /> <%= for channel <- @channels do %> - + <%= channel.name %> diff --git a/lib/chiya_web/controllers/page_html/note.html.heex b/lib/chiya_web/controllers/page_html/note.html.heex index b6034a9..0cbb261 100644 --- a/lib/chiya_web/controllers/page_html/note.html.heex +++ b/lib/chiya_web/controllers/page_html/note.html.heex @@ -3,6 +3,16 @@ <%= @note.name %> + <%= if @current_user do %> + + + + <.icon name="hero-pencil-square" /> Edit + Show in Admin + + + <% end %> + <%= if has_outline?(@note) do %>