Add signup page
This commit is contained in:
parent
d7016e693b
commit
2b4c0e9417
13
server/router/handler/signup.go
Normal file
13
server/router/handler/signup.go
Normal 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)
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
@ -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()
|
||||
|
23
server/router/pages/signup.templ
Normal file
23
server/router/pages/signup.templ
Normal 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>
|
||||
}
|
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user