diff --git a/pkg/common/styles/forms/register_passkey.templ b/app/gateway/internal/pages/register/creds.templ similarity index 98% rename from pkg/common/styles/forms/register_passkey.templ rename to app/gateway/internal/pages/register/creds.templ index 6550a7d35..03f868385 100644 --- a/pkg/common/styles/forms/register_passkey.templ +++ b/app/gateway/internal/pages/register/creds.templ @@ -1,4 +1,4 @@ -package forms +package register type RegisterPasskeyData struct { Address string @@ -8,7 +8,7 @@ type RegisterPasskeyData struct { CreationBlock string } -templ RegisterPasskey(action, method string, data RegisterPasskeyData) { +templ formRegisterPasskey(action, method string, data RegisterPasskeyData) {
diff --git a/pkg/common/styles/forms/register_passkey_templ.go b/app/gateway/internal/pages/register/creds_templ.go similarity index 92% rename from pkg/common/styles/forms/register_passkey_templ.go rename to app/gateway/internal/pages/register/creds_templ.go index 31ca66392..b5ae7418b 100644 --- a/pkg/common/styles/forms/register_passkey_templ.go +++ b/app/gateway/internal/pages/register/creds_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.793 -package forms +package register //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -16,7 +16,7 @@ type RegisterPasskeyData struct { CreationBlock string } -func RegisterPasskey(action, method string, data RegisterPasskeyData) templ.Component { +func formRegisterPasskey(action, method string, data RegisterPasskeyData) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -53,7 +53,7 @@ func RegisterPasskey(action, method string, data RegisterPasskeyData) templ.Comp var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(method) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 12, Col: 55} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 12, Col: 55} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -304,7 +304,7 @@ func sonrProfile(addr string, name string, handle string, creationBlock string) var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(handle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 173, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 173, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -317,7 +317,7 @@ func sonrProfile(addr string, name string, handle string, creationBlock string) var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(shortenAddress(addr)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 180, Col: 58} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 180, Col: 58} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -330,7 +330,7 @@ func sonrProfile(addr string, name string, handle string, creationBlock string) var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(creationBlock) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 185, Col: 55} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 185, Col: 55} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -343,7 +343,7 @@ func sonrProfile(addr string, name string, handle string, creationBlock string) var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 189, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 189, Col: 32} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -386,7 +386,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(ticker) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 198, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 198, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -399,7 +399,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(ticker) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 199, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 199, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -412,7 +412,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 200, Col: 9} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 200, Col: 9} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -430,7 +430,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(ticker) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 204, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 204, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -443,7 +443,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(ticker) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 205, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 205, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -456,7 +456,7 @@ func cryptoWalletOption(ticker string, name string, isDefault bool) templ.Compon var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/register_passkey.templ`, Line: 206, Col: 9} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/creds.templ`, Line: 206, Col: 9} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { diff --git a/app/gateway/internal/pages/register/page.templ b/app/gateway/internal/pages/register/page.templ index 29f5cc937..97da3831b 100644 --- a/app/gateway/internal/pages/register/page.templ +++ b/app/gateway/internal/pages/register/page.templ @@ -1,25 +1,24 @@ package register import ( - "github.com/onsonr/sonr/pkg/common/styles/forms" "github.com/onsonr/sonr/pkg/common/styles/layout" "github.com/onsonr/sonr/pkg/common/styles/text" ) -templ ProfileFormView(data forms.CreateProfileData) { - @layout.Root("New Profile | Sonr.ID") { +templ ProfileFormView(data CreateProfileData) { + @layout.Root("Create Profile | Sonr.ID") { @layout.Container() { - @text.Header("Create a Profile", "Enter some basic information about yourself.") - @forms.CreateProfile("/register/start", "POST", data) + @text.Header("Basic Info", "Tell us a little about yourself.") + @formCreateProfile("/register/start", "POST", data) } } } -templ LinkCredentialView(data forms.RegisterPasskeyData) { +templ LinkCredentialView(data RegisterPasskeyData) { @layout.Root("Register | Sonr.ID") { @layout.Container() { @text.Header("Link a PassKey", "This will be used to login to your vault.") - @forms.RegisterPasskey("/register/finish", "POST", data) + @formRegisterPasskey("/register/finish", "POST", data) } } } diff --git a/app/gateway/internal/pages/register/page_templ.go b/app/gateway/internal/pages/register/page_templ.go index 6dfe8f63c..955e0c7a6 100644 --- a/app/gateway/internal/pages/register/page_templ.go +++ b/app/gateway/internal/pages/register/page_templ.go @@ -9,12 +9,11 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/common/styles/forms" "github.com/onsonr/sonr/pkg/common/styles/layout" "github.com/onsonr/sonr/pkg/common/styles/text" ) -func ProfileFormView(data forms.CreateProfileData) templ.Component { +func ProfileFormView(data CreateProfileData) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -59,7 +58,7 @@ func ProfileFormView(data forms.CreateProfileData) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = text.Header("Create a Profile", "Enter some basic information about yourself.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = text.Header("Basic Info", "Tell us a little about yourself.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -67,7 +66,7 @@ func ProfileFormView(data forms.CreateProfileData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = forms.CreateProfile("/register/start", "POST", data).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = formCreateProfile("/register/start", "POST", data).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -79,7 +78,7 @@ func ProfileFormView(data forms.CreateProfileData) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = layout.Root("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Create Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -87,7 +86,7 @@ func ProfileFormView(data forms.CreateProfileData) templ.Component { }) } -func LinkCredentialView(data forms.RegisterPasskeyData) templ.Component { +func LinkCredentialView(data RegisterPasskeyData) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -140,7 +139,7 @@ func LinkCredentialView(data forms.RegisterPasskeyData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = forms.RegisterPasskey("/register/finish", "POST", data).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = formRegisterPasskey("/register/finish", "POST", data).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/common/styles/forms/create_profile.templ b/app/gateway/internal/pages/register/profile.templ similarity index 79% rename from pkg/common/styles/forms/create_profile.templ rename to app/gateway/internal/pages/register/profile.templ index ce33babe2..ace683b7c 100644 --- a/pkg/common/styles/forms/create_profile.templ +++ b/app/gateway/internal/pages/register/profile.templ @@ -1,4 +1,4 @@ -package forms +package register import ( "fmt" @@ -15,8 +15,7 @@ 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, data CreateProfileData) { +templ formCreateProfile(action string, method string, data CreateProfileData) {
@@ -73,3 +72,7 @@ templ CreateProfile(action string, method string, data CreateProfileData) { } + +// ╭──────────────────────────────────────────────────────╮ +// │ Passkey Components │ +// ╰──────────────────────────────────────────────────────╯ diff --git a/pkg/common/styles/forms/create_profile_templ.go b/app/gateway/internal/pages/register/profile_templ.go similarity index 76% rename from pkg/common/styles/forms/create_profile_templ.go rename to app/gateway/internal/pages/register/profile_templ.go index 5a644dade..da23c1b2d 100644 --- a/pkg/common/styles/forms/create_profile_templ.go +++ b/app/gateway/internal/pages/register/profile_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.793 -package forms +package register //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -23,8 +23,7 @@ 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 -func CreateProfile(action string, method string, data CreateProfileData) templ.Component { +func formCreateProfile(action string, method string, data CreateProfileData) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -61,13 +60,13 @@ func CreateProfile(action string, method string, data CreateProfileData) templ.C var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(method) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/create_profile.templ`, Line: 20, Col: 55} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/profile.templ`, Line: 19, Col: 55} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -112,13 +111,13 @@ func CreateProfile(action string, method string, data CreateProfileData) templ.C var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.IsHumanLabel()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/common/styles/forms/create_profile.templ`, Line: 38, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/gateway/internal/pages/register/profile.templ`, Line: 37, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\">
Cancel Next
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\">
Cancel Next
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -126,4 +125,7 @@ func CreateProfile(action string, method string, data CreateProfileData) templ.C }) } +// ╭──────────────────────────────────────────────────────╮ +// │ Passkey Components │ +// ╰──────────────────────────────────────────────────────╯ var _ = templruntime.GeneratedTemplate