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