fix: correct title of profile creation page

This commit is contained in:
Prad Nukala 2024-12-11 13:26:26 -05:00
parent 305efbea5d
commit 0d4f2946f3
6 changed files with 14 additions and 13 deletions

View File

@ -6,6 +6,7 @@ import (
"net/http"
"github.com/labstack/echo/v4"
"golang.org/x/exp/rand"
)
// Define the credential structure matching our frontend data
@ -76,3 +77,10 @@ func extractCredentialDescriptor(jsonString string) (*Credential, error) {
)
return cred, nil
}
func randomCreateProfileData() CreateProfileData {
return CreateProfileData{
FirstNumber: rand.Intn(5) + 1,
LastNumber: rand.Intn(4) + 1,
}
}

View File

@ -8,11 +8,11 @@ import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/crypto/mpc"
"github.com/onsonr/sonr/pkg/common/response"
"golang.org/x/exp/rand"
)
func HandleCreateProfile(c echo.Context) error {
return response.TemplEcho(c, ProfileFormView(randomCreateProfileData()))
d := randomCreateProfileData()
return response.TemplEcho(c, ProfileFormView(d))
}
func HandlePasskeyStart(c echo.Context) error {
@ -47,10 +47,3 @@ func HandlePasskeyFinish(c echo.Context) error {
}
return response.TemplEcho(c, LoadingVaultView())
}
func randomCreateProfileData() CreateProfileData {
return CreateProfileData{
FirstNumber: rand.Intn(5) + 1,
LastNumber: rand.Intn(4) + 1,
}
}

View File

@ -6,7 +6,7 @@ import (
)
templ ProfileFormView(data CreateProfileData) {
@layout.Root("Create Profile | Sonr.ID") {
@layout.Root("New Profile | Sonr.ID") {
@layout.Container() {
@text.Header("Basic Info", "Tell us a little about yourself.")
@formCreateProfile("/register/start", "POST", data)

View File

@ -78,7 +78,7 @@ func ProfileFormView(data CreateProfileData) templ.Component {
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Create Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.Root("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@ -10,7 +10,7 @@ templ Columns() {
templ Container() {
<div id="container" class="flex fixed inset-0 z-[99] w-screen h-screen">
<div class="relative flex flex-wrap items-center w-full h-full px-8">
<div class="relative w-full max-w-sm mx-auto lg:mb-0">
<div class="relative w-full max-w-screen-lg mx-auto lg:mb-0">
<div class="flex flex-col items-center justify-center h-full">
{ children... }
</div>

View File

@ -67,7 +67,7 @@ func Container() templ.Component {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"container\" class=\"flex fixed inset-0 z-[99] w-screen h-screen\"><div class=\"relative flex flex-wrap items-center w-full h-full px-8\"><div class=\"relative w-full max-w-sm mx-auto lg:mb-0\"><div class=\"flex flex-col items-center justify-center h-full\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"container\" class=\"flex fixed inset-0 z-[99] w-screen h-screen\"><div class=\"relative flex flex-wrap items-center w-full h-full px-8\"><div class=\"relative w-full max-w-screen-lg mx-auto lg:mb-0\"><div class=\"flex flex-col items-center justify-center h-full\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}