From ab33d8235f27b91a587e1f3c0d26b6d3ae0f90d3 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Tue, 1 Oct 2024 17:58:05 -0400 Subject: [PATCH] fix(hero): Use hx-swap for primary button to prevent flicker --- pkg/nebula/components/home/hero.templ | 2 +- pkg/nebula/components/home/hero_templ.go | 6 ++-- pkg/nebula/components/register/modal.templ | 15 ++++------ pkg/nebula/components/register/modal_templ.go | 30 ++----------------- pkg/nebula/components/register/view.templ | 1 - pkg/nebula/components/register/view_templ.go | 8 ----- 6 files changed, 11 insertions(+), 51 deletions(-) diff --git a/pkg/nebula/components/home/hero.templ b/pkg/nebula/components/home/hero.templ index 742fba8de..4a9dcb5f2 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/pkg/nebula/components/home/hero.templ @@ -25,7 +25,7 @@ templ SectionHero(hero *models.Hero) {

-
{ hero.PrimaryButton.Text }
+
{ hero.PrimaryButton.Text }
{ hero.SecondaryButton.Text } diff --git a/pkg/nebula/components/home/hero_templ.go b/pkg/nebula/components/home/hero_templ.go index 16ba44a8c..cc03963b1 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/pkg/nebula/components/home/hero_templ.go @@ -83,14 +83,14 @@ func SectionHero(hero *models.Hero) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

-

Modal Title

-
-

This is placeholder text. Replace it with your own content.

+

Enter your account information below to create your account.

- @blocks.H2("Account Registration") - @blocks.Spacer() @blocks.Breadcrumbs() @basicInfoForm(formstate.Initial) @blocks.Spacer() - @blocks.Button(blocks.GET("/", "#register-view")) { - @blocks.Text("Cancel") - }
- +
diff --git a/pkg/nebula/components/register/modal_templ.go b/pkg/nebula/components/register/modal_templ.go index 1fc2c5e9d..5c062dfad 100644 --- a/pkg/nebula/components/register/modal_templ.go +++ b/pkg/nebula/components/register/modal_templ.go @@ -35,11 +35,7 @@ func Modal(c echo.Context) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/register/view.templ b/pkg/nebula/components/register/view.templ index 5ccd95833..b162d5879 100644 --- a/pkg/nebula/components/register/view.templ +++ b/pkg/nebula/components/register/view.templ @@ -9,7 +9,6 @@ import ( templ View(c echo.Context) { @blocks.Layout("Sonr.ID", true) { @blocks.Card("register-view", blocks.SizeMedium) { - @blocks.H2("Account Registration") @blocks.Spacer() @blocks.Breadcrumbs() @basicInfoForm(formstate.Initial) diff --git a/pkg/nebula/components/register/view_templ.go b/pkg/nebula/components/register/view_templ.go index c129d4f58..b4fa6d8c4 100644 --- a/pkg/nebula/components/register/view_templ.go +++ b/pkg/nebula/components/register/view_templ.go @@ -59,14 +59,6 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H2("Account Registration").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err