Add signup page

This commit is contained in:
ekzyis 2024-07-12 07:18:37 +02:00
parent d7016e693b
commit 2b4c0e9417
5 changed files with 39 additions and 2 deletions

View File

@ -0,0 +1,13 @@
package handler
import (
"git.ekzyis.com/ekzyis/delphi.market/server/router/context"
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages"
"github.com/labstack/echo/v4"
)
func HandleSignup(sc context.Context) echo.HandlerFunc {
return func(c echo.Context) error {
return pages.Signup().Render(context.RenderContext(sc, c), c.Response().Writer)
}
}

View File

@ -13,7 +13,7 @@ templ Header() {
if ctx.Value(c.SessionContextKey) != nil {
<button hx-get="/user">user</button>
} else {
<button hx-get="/login">login</button>
<button hx-get="/signup">signup</button>
}
</div>
</nav>

View File

@ -14,7 +14,7 @@ templ Login() {
<button class="login nostr my-3">login with nostr</button>
</div>
<div class="flex flex-col mb-3 text-center">
<small><a class="text-muted" href="/signup">new here?</a></small>
<small><a class="text-muted" href="/signup">first time?</a></small>
</div>
</div>
@components.Footer()

View File

@ -0,0 +1,23 @@
package pages
import "git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
templ Signup() {
<html>
@components.Head()
<body class="container">
@components.Header()
<div id="content" class="flex flex-col text-center">
@components.Figlet("random", "signup")
<div class="flex flex-col mb-3 text-center">
<button class="login lightning my-3">signup with lightning</button>
<button class="login nostr my-3">signup with nostr</button>
</div>
<div class="flex flex-col mb-3 text-center">
<small><a class="text-muted" href="/login">not your first time?</a></small>
</div>
</div>
@components.Footer()
</body>
</html>
}

View File

@ -15,4 +15,5 @@ func Init(e *echo.Echo, sc Context) {
e.GET("/", handler.HandleIndex(sc))
e.GET("/about", handler.HandleAbout(sc))
e.GET("/login", handler.HandleLogin(sc))
e.GET("/signup", handler.HandleSignup(sc))
}