user action in header
This commit is contained in:
parent
acd020ed3b
commit
f6346f8165
4 changed files with 44 additions and 12 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
20
blog/src/islands/UserAction.tsx
Normal file
20
blog/src/islands/UserAction.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
8
blog/src/pages/login.astro
Normal file
8
blog/src/pages/login.astro
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
import Main from "../layouts/Main.astro";
|
||||||
|
---
|
||||||
|
|
||||||
|
<Main>
|
||||||
|
|
||||||
|
|
||||||
|
</Main>
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
@ -74,7 +79,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog-image {
|
.blog-image {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue