Also show lightning address
This commit is contained in:
parent
a5a6a1711a
commit
0393817939
|
@ -3,7 +3,7 @@ package pages
|
||||||
import "github.com/skip2/go-qrcode"
|
import "github.com/skip2/go-qrcode"
|
||||||
import "encoding/base64"
|
import "encoding/base64"
|
||||||
|
|
||||||
templ Overlay(lnurl string) {
|
templ Overlay(lnurl string, lnaddr string) {
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -29,8 +29,11 @@ templ Overlay(lnurl string) {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<div class="bg-white fixed bottom-0 left-0 text-center p-3">
|
<div class="bg-white fixed bottom-0 left-0 text-center p-3">
|
||||||
|
<div class="p-2">
|
||||||
|
<div class="font-bold">{ lnaddr }</div>
|
||||||
<img src={ "data:image/jpeg;base64," + qrEncode(lnurl) }/>
|
<img src={ "data:image/jpeg;base64," + qrEncode(lnurl) }/>
|
||||||
<div>scan to zap message</div>
|
</div>
|
||||||
|
<div class="italic">zap us a message!</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -27,9 +27,9 @@ func GetEnv(ctx context.Context) string {
|
||||||
return "development"
|
return "development"
|
||||||
}
|
}
|
||||||
|
|
||||||
func OverlayHandler(lnurl string) echo.HandlerFunc {
|
func OverlayHandler(lnurl string, lnaddr string) echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
return render(c, http.StatusOK, Overlay(lnurl))
|
return render(c, http.StatusOK, Overlay(lnurl, lnaddr))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,11 @@ func NewServer() *Server {
|
||||||
CustomTimeFormat: "2006-01-02 15:04:05.00000-0700",
|
CustomTimeFormat: "2006-01-02 15:04:05.00000-0700",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
u, err := url.Parse(env.PublicUrl)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
webhookPath := "/overlay/webhook"
|
webhookPath := "/overlay/webhook"
|
||||||
webhookUrl, err := url.JoinPath(env.PublicUrl, webhookPath)
|
webhookUrl, err := url.JoinPath(env.PublicUrl, webhookPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -46,7 +51,8 @@ func NewServer() *Server {
|
||||||
s.Static("/", "public/")
|
s.Static("/", "public/")
|
||||||
|
|
||||||
s.GET("/overlay", pages.OverlayHandler(
|
s.GET("/overlay", pages.OverlayHandler(
|
||||||
lnurl.Encode(fmt.Sprintf("%s/.well-known/lnurlp/%s", env.PublicUrl, "SNL")),
|
lnurl.Encode(fmt.Sprintf("%s/.well-known/lnurlp/%s", env.PublicUrl, "snl")),
|
||||||
|
fmt.Sprintf("%s@%s", "snl", u.Host),
|
||||||
))
|
))
|
||||||
s.GET("/overlay/sse", sseHandler(p.IncomingPayments()))
|
s.GET("/overlay/sse", sseHandler(p.IncomingPayments()))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue