user action in header

This commit is contained in:
ebby 2026-10-04 15:13:06 +02:00
parent acd020ed3b
commit f6346f8165
4 changed files with 44 additions and 12 deletions

View file

@ -1,5 +1,8 @@
--- ---
import UserAction from "../islands/UserAction";
import Logo from "./Logo.astro"; import Logo from "./Logo.astro";
--- ---
<header> <header>
@ -11,8 +14,9 @@ import Logo from "./Logo.astro";
<a href="/">Startseite</a> <a href="/">Startseite</a>
</div> </div>
<div class="nav-right"> <div class="nav-right">
<a href="/impressum" style="#789">Impressum</a> <UserAction client:only/>
<a href="/privacy-policy" style="#789">Datenschutz</a> <a href="/impressum" class="menu-nav">Impressum</a>
<a href="/privacy-policy" class="menu-nav">Datenschutz</a>
</div> </div>
</nav> </nav>
@ -53,11 +57,6 @@ import Logo from "./Logo.astro";
gap: 16px; gap: 16px;
} }
a {
color: var(--primary-text);
text-decoration: none;
}
#menu-toggle, #menu-toggle,
.menu-icon, .menu-icon,
.menu-backdrop, .menu-backdrop,

View file

@ -0,0 +1,20 @@
export default function LoginForm() {
let text = "⚓︎ Login"
let link = "/login"
const username = localStorage.getItem("username")
if (username) {
text = `⚓︎ ${username}`
link = "/user"
}
return (
<a
href={link}
class="menu-nav"
style="font-weight: bolder;">
{text}
</a>
);
}

View file

@ -0,0 +1,8 @@
---
import Main from "../layouts/Main.astro";
---
<Main>
</Main>

View file

@ -34,6 +34,11 @@ body {
color: black; color: black;
} }
.menu-nav {
color: var(--primary-text);
text-decoration: none;
}
.nav-link:hover { .nav-link:hover {
text-decoration: underline; text-decoration: underline;
} }
@ -77,4 +82,4 @@ body {
max-height: 500px; max-height: 500px;
object-fit: cover; object-fit: cover;
object-position: center; object-position: center;
} }