mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat: implement passkey registration flow
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
package forms
|
||||
|
||||
import "github.com/onsonr/sonr/pkg/blocks/layout"
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/onsonr/sonr/pkg/blocks/layout"
|
||||
)
|
||||
|
||||
type CreateProfileData struct {
|
||||
TurnstileSiteKey string
|
||||
FirstNumber int
|
||||
LastNumber int
|
||||
}
|
||||
|
||||
func (d CreateProfileData) IsHumanLabel() string {
|
||||
return fmt.Sprintf("What is %d + %d?", d.FirstNumber, d.LastNumber)
|
||||
}
|
||||
|
||||
// ProfileForm is a standard form styled like a card
|
||||
templ CreateProfile(action string, method string) {
|
||||
templ CreateProfile(action string, method string, data CreateProfileData) {
|
||||
<form action={ templ.SafeURL(action) } method={ method }>
|
||||
<sl-card class="card-form gap-4 max-w-lg">
|
||||
<div slot="header">
|
||||
@@ -21,6 +34,8 @@ templ CreateProfile(action string, method string) {
|
||||
<sl-icon name="at-sign" library="sonr"></sl-icon>
|
||||
</div>
|
||||
</sl-input>
|
||||
@layout.Spacer()
|
||||
<sl-range name="is_human" label={ data.IsHumanLabel() } help-text="Prove you are a human." min="0" max="9" step="1"></sl-range>
|
||||
<div slot="footer">
|
||||
<sl-button href="/" outline>
|
||||
<sl-icon slot="prefix" name="arrow-left" library="sonr"></sl-icon>
|
||||
@@ -41,3 +56,6 @@ templ CreateProfile(action string, method string) {
|
||||
</sl-card>
|
||||
</form>
|
||||
}
|
||||
|
||||
templ isHumanSlider(targetSum string) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user