Add htmx to the project

This commit is contained in:
2024-06-13 17:20:57 +07:00
parent c5c697a84c
commit 276d62af3d
7 changed files with 16 additions and 13 deletions

View File

@ -20,12 +20,12 @@ templ content(title string, user types.User) {
<div class="rounded-md shadow">
if user.Authenticated {
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
href="/user">
href="/user" hx-get="/user" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
Open Dashboard
</a>
} else {
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
href="/signup">
href="/signup" hx-get="/signup" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
Get started
</a>
}