22 lines
549 B
Plaintext
Raw Normal View History

2024-07-10 06:21:22 +02:00
package components
import c "git.ekzyis.com/ekzyis/delphi.market/server/router/context"
templ Header() {
2024-07-10 07:47:01 +02:00
<header class="mt-3">
2024-07-12 05:40:45 +02:00
<nav class="flex flex-row" hx-target="#content" hx-swap="outerHTML" hx-select="#content" hx-push-url="true">
2024-07-10 07:47:01 +02:00
<div>
2024-07-12 05:40:45 +02:00
<button hx-get="/">home</button>
2024-07-10 07:47:01 +02:00
</div>
<div class="ms-auto">
2024-07-12 05:40:45 +02:00
<button hx-get="/about">about</button>
2024-07-10 07:47:01 +02:00
if ctx.Value(c.SessionContextKey) != nil {
2024-07-12 05:40:45 +02:00
<button hx-get="/user">user</button>
2024-07-10 07:47:01 +02:00
} else {
2024-07-12 05:40:45 +02:00
<button hx-get="/login">login</button>
2024-07-10 07:47:01 +02:00
}
</div>
2024-07-10 06:21:22 +02:00
</nav>
</header>
}