From c35d3bb1ae675c62ec2362ba8fb7d6b1093ee16a Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:31:39 -0400 Subject: [PATCH] refactor: move ui components to global --- pkg/nebula/components/home/footer.templ | 2 +- pkg/nebula/components/home/footer_templ.go | 2 +- pkg/nebula/components/home/hero.templ | 2 +- pkg/nebula/components/home/hero_templ.go | 2 +- pkg/nebula/components/ui/button.templ | 13 --- pkg/nebula/components/ui/button_templ.go | 121 --------------------- 6 files changed, 4 insertions(+), 138 deletions(-) delete mode 100644 pkg/nebula/components/ui/button.templ delete mode 100644 pkg/nebula/components/ui/button_templ.go diff --git a/pkg/nebula/components/home/footer.templ b/pkg/nebula/components/home/footer.templ index 94c68ba79..3c7aae22c 100644 --- a/pkg/nebula/components/home/footer.templ +++ b/pkg/nebula/components/home/footer.templ @@ -11,7 +11,7 @@ templ Footer() {
- Logo + Logo
© diDAO DUNA. All rights reserved.
diff --git a/pkg/nebula/components/home/footer_templ.go b/pkg/nebula/components/home/footer_templ.go index b036f4ece..e0ec437ee 100644 --- a/pkg/nebula/components/home/footer_templ.go +++ b/pkg/nebula/components/home/footer_templ.go @@ -29,7 +29,7 @@ func Footer() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/hero.templ b/pkg/nebula/components/home/hero.templ index 9eda2d7e1..af7fa387f 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/pkg/nebula/components/home/hero.templ @@ -1,7 +1,7 @@ package home import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" + "github.com/onsonr/sonr/pkg/nebula/global/ui" "github.com/onsonr/sonr/pkg/nebula/models" ) diff --git a/pkg/nebula/components/home/hero_templ.go b/pkg/nebula/components/home/hero_templ.go index 84de2bf4f..c49cc83fd 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/pkg/nebula/components/home/hero_templ.go @@ -9,7 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" + "github.com/onsonr/sonr/pkg/nebula/global/ui" "github.com/onsonr/sonr/pkg/nebula/models" ) diff --git a/pkg/nebula/components/ui/button.templ b/pkg/nebula/components/ui/button.templ deleted file mode 100644 index 3d488ea97..000000000 --- a/pkg/nebula/components/ui/button.templ +++ /dev/null @@ -1,13 +0,0 @@ -package ui - -templ PrimaryButton(href string, text string) { -
-
{ text }
-
-} - -templ SecondaryButton(href string, text string) { -
-
{ text }
-
-} diff --git a/pkg/nebula/components/ui/button_templ.go b/pkg/nebula/components/ui/button_templ.go deleted file mode 100644 index 86b8787f9..000000000 --- a/pkg/nebula/components/ui/button_templ.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package ui - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func PrimaryButton(href string, text string) 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 { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - 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 - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 5, Col: 133} - } - _, 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("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func SecondaryButton(href string, text string) 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 { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 11, Col: 132} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - 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 - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate