From 37fb0b3aca493ac0865e8268cbfb257bbdd06218 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 7 Oct 2024 10:39:50 -0400 Subject: [PATCH] refactor: remove unused component templates --- app/proxy/proxycmd.go | 56 ------------ cmd/hway/server/server.go | 4 +- cmd/sonrd/main.go | 2 - pkg/nebula/components/grant/view.templ | 17 ---- pkg/nebula/components/grant/view_templ.go | 91 ------------------- .../home/{ => sections}/bento.templ | 2 +- .../home/{ => sections}/bento_templ.go | 2 +- .../components/home/{ => sections}/cta.templ | 3 +- .../home/{ => sections}/cta_templ.go | 2 +- .../home/{ => sections}/features.templ | 3 +- .../home/{ => sections}/features_templ.go | 2 +- .../home/{ => sections}/footer.templ | 2 +- .../home/{ => sections}/footer_templ.go | 2 +- .../home/{ => sections}/header.templ | 2 +- .../home/{ => sections}/header_templ.go | 2 +- .../components/home/{ => sections}/hero.templ | 2 +- .../home/{ => sections}/hero_templ.go | 16 ++-- .../home/{ => sections}/highlights.templ | 2 +- .../home/{ => sections}/highlights_templ.go | 2 +- .../home/{ => sections}/lowlights.templ | 2 +- .../home/{ => sections}/lowlights_templ.go | 2 +- pkg/nebula/components/home/view.templ | 17 ++-- pkg/nebula/components/home/view_templ.go | 17 ++-- pkg/nebula/components/profile/view.templ | 15 --- pkg/nebula/components/profile/view_templ.go | 82 ----------------- pkg/nebula/global/styles/layout.templ | 48 ++++++++++ pkg/nebula/global/styles/layout_templ.go | 63 +++++++++++++ pkg/nebula/router/router.go | 9 -- 28 files changed, 156 insertions(+), 313 deletions(-) delete mode 100644 app/proxy/proxycmd.go delete mode 100644 pkg/nebula/components/grant/view.templ delete mode 100644 pkg/nebula/components/grant/view_templ.go rename pkg/nebula/components/home/{ => sections}/bento.templ (99%) rename pkg/nebula/components/home/{ => sections}/bento_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/cta.templ (99%) rename pkg/nebula/components/home/{ => sections}/cta_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/features.templ (99%) rename pkg/nebula/components/home/{ => sections}/features_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/footer.templ (99%) rename pkg/nebula/components/home/{ => sections}/footer_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/header.templ (98%) rename pkg/nebula/components/home/{ => sections}/header_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/hero.templ (99%) rename pkg/nebula/components/home/{ => sections}/hero_templ.go (97%) rename pkg/nebula/components/home/{ => sections}/highlights.templ (99%) rename pkg/nebula/components/home/{ => sections}/highlights_templ.go (99%) rename pkg/nebula/components/home/{ => sections}/lowlights.templ (99%) rename pkg/nebula/components/home/{ => sections}/lowlights_templ.go (99%) delete mode 100644 pkg/nebula/components/profile/view.templ delete mode 100644 pkg/nebula/components/profile/view_templ.go diff --git a/app/proxy/proxycmd.go b/app/proxy/proxycmd.go deleted file mode 100644 index f50d39b75..000000000 --- a/app/proxy/proxycmd.go +++ /dev/null @@ -1,56 +0,0 @@ -package proxy - -import ( - "context" - "net/http" - "os" - "os/signal" - "time" - - "github.com/labstack/echo/v4" - "github.com/labstack/gommon/log" - "github.com/spf13/cobra" - - "github.com/onsonr/sonr/pkg/nebula" - "github.com/onsonr/sonr/pkg/nebula/router" -) - -func NewProxyCmd() *cobra.Command { - return &cobra.Command{ - Use: "dwn-proxy", - Short: "Starts the DWN proxy server for the local IPFS node", - Run: func(cmd *cobra.Command, args []string) { - // Echo instance - e := echo.New() - e.Logger.SetLevel(log.INFO) - - // Configure the server - if err := nebula.UseAssets(e); err != nil { - e.Logger.Fatal(err) - } - - e.GET("/", router.Home) - e.GET("/allocate", router.Profile) - - // Start server - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) - defer stop() - // Start server - go func() { - if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed { - e.Logger.Fatal("shutting down the server") - } - }() - - // Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds. - <-ctx.Done() - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - // Shutdown the server with 10 seconds timeout. - if err := e.Shutdown(ctx); err != nil { - e.Logger.Fatal(err) - } - }, - } -} diff --git a/cmd/hway/server/server.go b/cmd/hway/server/server.go index 9feba1d47..bb8dc3bdb 100644 --- a/cmd/hway/server/server.go +++ b/cmd/hway/server/server.go @@ -28,8 +28,8 @@ func New() *Server { s.GET("/", router.Home) s.GET("/login", router.Login) s.GET("/register", router.Register) - s.GET("/profile", router.Profile) - s.GET("/authorize", router.Authorize) + // s.GET("/profile", router.Profile) + // s.GET("/authorize", router.Authorize) return s } diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 79fc87b98..d3f50eab5 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -9,14 +9,12 @@ import ( "github.com/onsonr/sonr/app" "github.com/onsonr/sonr/app/cli" - "github.com/onsonr/sonr/app/proxy" ) func main() { rootCmd := NewRootCmd() rootCmd.AddCommand(cli.NewBuildTxnTUICmd()) rootCmd.AddCommand(cli.NewExplorerTUICmd()) - rootCmd.AddCommand(proxy.NewProxyCmd()) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/pkg/nebula/components/grant/view.templ b/pkg/nebula/components/grant/view.templ deleted file mode 100644 index 56c844581..000000000 --- a/pkg/nebula/components/grant/view.templ +++ /dev/null @@ -1,17 +0,0 @@ -package grant - -import ( - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -templ View(c echo.Context) { - @styles.Layout("Sonr.ID", true) { - @ui.Card("authorize-view", styles.SizeMedium) { - @styles.H1("Sonr.ID") - @styles.Text("Neo-tree is a file manager for NeoFS.") - } - } -} diff --git a/pkg/nebula/components/grant/view_templ.go b/pkg/nebula/components/grant/view_templ.go deleted file mode 100644 index 13bb0d7ee..000000000 --- a/pkg/nebula/components/grant/view_templ.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package grant - -//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" - -import ( - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -func View(c echo.Context) 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_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - 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_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - 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_Err = styles.H1("Sonr.ID").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 = styles.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Card("authorize-view", styles.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/bento.templ b/pkg/nebula/components/home/sections/bento.templ similarity index 99% rename from pkg/nebula/components/home/bento.templ rename to pkg/nebula/components/home/sections/bento.templ index d28941aad..51ce476df 100644 --- a/pkg/nebula/components/home/bento.templ +++ b/pkg/nebula/components/home/sections/bento.templ @@ -1,4 +1,4 @@ -package home +package sections templ Bento() { diff --git a/pkg/nebula/components/home/bento_templ.go b/pkg/nebula/components/home/sections/bento_templ.go similarity index 99% rename from pkg/nebula/components/home/bento_templ.go rename to pkg/nebula/components/home/sections/bento_templ.go index 2c25e5b85..2c33d796e 100644 --- a/pkg/nebula/components/home/bento_templ.go +++ b/pkg/nebula/components/home/sections/bento_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/cta.templ b/pkg/nebula/components/home/sections/cta.templ similarity index 99% rename from pkg/nebula/components/home/cta.templ rename to pkg/nebula/components/home/sections/cta.templ index e94973686..c3dc9fa0e 100644 --- a/pkg/nebula/components/home/cta.templ +++ b/pkg/nebula/components/home/sections/cta.templ @@ -1,4 +1,5 @@ -package home +package sections + templ CallToAction() {
diff --git a/pkg/nebula/components/home/cta_templ.go b/pkg/nebula/components/home/sections/cta_templ.go similarity index 99% rename from pkg/nebula/components/home/cta_templ.go rename to pkg/nebula/components/home/sections/cta_templ.go index 44d5e0a6f..31de9ca2f 100644 --- a/pkg/nebula/components/home/cta_templ.go +++ b/pkg/nebula/components/home/sections/cta_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/features.templ b/pkg/nebula/components/home/sections/features.templ similarity index 99% rename from pkg/nebula/components/home/features.templ rename to pkg/nebula/components/home/sections/features.templ index a7c1d09e9..0a4828fcb 100644 --- a/pkg/nebula/components/home/features.templ +++ b/pkg/nebula/components/home/sections/features.templ @@ -1,4 +1,5 @@ -package home +package sections + templ Features() { diff --git a/pkg/nebula/components/home/features_templ.go b/pkg/nebula/components/home/sections/features_templ.go similarity index 99% rename from pkg/nebula/components/home/features_templ.go rename to pkg/nebula/components/home/sections/features_templ.go index b7edd8a4e..679e0ac08 100644 --- a/pkg/nebula/components/home/features_templ.go +++ b/pkg/nebula/components/home/sections/features_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/footer.templ b/pkg/nebula/components/home/sections/footer.templ similarity index 99% rename from pkg/nebula/components/home/footer.templ rename to pkg/nebula/components/home/sections/footer.templ index 3c7aae22c..9afbb64c7 100644 --- a/pkg/nebula/components/home/footer.templ +++ b/pkg/nebula/components/home/sections/footer.templ @@ -1,4 +1,4 @@ -package home +package sections templ Footer() { diff --git a/pkg/nebula/components/home/footer_templ.go b/pkg/nebula/components/home/sections/footer_templ.go similarity index 99% rename from pkg/nebula/components/home/footer_templ.go rename to pkg/nebula/components/home/sections/footer_templ.go index e0ec437ee..7dc321650 100644 --- a/pkg/nebula/components/home/footer_templ.go +++ b/pkg/nebula/components/home/sections/footer_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/header.templ b/pkg/nebula/components/home/sections/header.templ similarity index 98% rename from pkg/nebula/components/home/header.templ rename to pkg/nebula/components/home/sections/header.templ index 5e6e101cc..e5ff3b986 100644 --- a/pkg/nebula/components/home/header.templ +++ b/pkg/nebula/components/home/sections/header.templ @@ -1,4 +1,4 @@ -package home +package sections templ Header() { diff --git a/pkg/nebula/components/home/header_templ.go b/pkg/nebula/components/home/sections/header_templ.go similarity index 99% rename from pkg/nebula/components/home/header_templ.go rename to pkg/nebula/components/home/sections/header_templ.go index 029da6a57..b40a38a4e 100644 --- a/pkg/nebula/components/home/header_templ.go +++ b/pkg/nebula/components/home/sections/header_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/hero.templ b/pkg/nebula/components/home/sections/hero.templ similarity index 99% rename from pkg/nebula/components/home/hero.templ rename to pkg/nebula/components/home/sections/hero.templ index af7fa387f..c97da18f7 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/pkg/nebula/components/home/sections/hero.templ @@ -1,4 +1,4 @@ -package home +package sections import ( "github.com/onsonr/sonr/pkg/nebula/global/ui" diff --git a/pkg/nebula/components/home/hero_templ.go b/pkg/nebula/components/home/sections/hero_templ.go similarity index 97% rename from pkg/nebula/components/home/hero_templ.go rename to pkg/nebula/components/home/sections/hero_templ.go index c49cc83fd..e8b3c0ca6 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/pkg/nebula/components/home/sections/hero_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -41,7 +41,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleFirst) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 17, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 17, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -54,7 +54,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleEmphasis) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 19, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 19, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -67,7 +67,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleSecond) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 24, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 24, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -80,7 +80,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 27, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 27, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -146,7 +146,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Src) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 47, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 47, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Width) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 48, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 48, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -172,7 +172,7 @@ func heroImage(hero *models.Hero) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Height) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 49, Col: 29} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/sections/hero.templ`, Line: 49, Col: 29} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/home/highlights.templ b/pkg/nebula/components/home/sections/highlights.templ similarity index 99% rename from pkg/nebula/components/home/highlights.templ rename to pkg/nebula/components/home/sections/highlights.templ index a8d2884cf..21d9c9929 100644 --- a/pkg/nebula/components/home/highlights.templ +++ b/pkg/nebula/components/home/sections/highlights.templ @@ -1,4 +1,4 @@ -package home +package sections templ Highlights() { diff --git a/pkg/nebula/components/home/highlights_templ.go b/pkg/nebula/components/home/sections/highlights_templ.go similarity index 99% rename from pkg/nebula/components/home/highlights_templ.go rename to pkg/nebula/components/home/sections/highlights_templ.go index c00f80c0d..38feb933f 100644 --- a/pkg/nebula/components/home/highlights_templ.go +++ b/pkg/nebula/components/home/sections/highlights_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/lowlights.templ b/pkg/nebula/components/home/sections/lowlights.templ similarity index 99% rename from pkg/nebula/components/home/lowlights.templ rename to pkg/nebula/components/home/sections/lowlights.templ index aecf235fb..1f2d696bf 100644 --- a/pkg/nebula/components/home/lowlights.templ +++ b/pkg/nebula/components/home/sections/lowlights.templ @@ -1,4 +1,4 @@ -package home +package sections templ Lowlights() {
diff --git a/pkg/nebula/components/home/lowlights_templ.go b/pkg/nebula/components/home/sections/lowlights_templ.go similarity index 99% rename from pkg/nebula/components/home/lowlights_templ.go rename to pkg/nebula/components/home/sections/lowlights_templ.go index 470b376ee..23d64a838 100644 --- a/pkg/nebula/components/home/lowlights_templ.go +++ b/pkg/nebula/components/home/sections/lowlights_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/view.templ b/pkg/nebula/components/home/view.templ index dddf771aa..2ea151907 100644 --- a/pkg/nebula/components/home/view.templ +++ b/pkg/nebula/components/home/view.templ @@ -2,18 +2,19 @@ package home import ( "github.com/onsonr/sonr/pkg/nebula/global/styles" + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" "github.com/onsonr/sonr/pkg/nebula/models" ) templ View(home *models.Home) { @styles.LayoutNoBody("Sonr.ID", true) { - @Header() - @SectionHero(home.Hero) - @Highlights() - @Features() - @Bento() - @Lowlights() - @CallToAction() - @Footer() + @sections.Header() + @sections.SectionHero(home.Hero) + @sections.Highlights() + @sections.Features() + @sections.Bento() + @sections.Lowlights() + @sections.CallToAction() + @sections.Footer() } } diff --git a/pkg/nebula/components/home/view_templ.go b/pkg/nebula/components/home/view_templ.go index e0f84500b..0fe0a9cfd 100644 --- a/pkg/nebula/components/home/view_templ.go +++ b/pkg/nebula/components/home/view_templ.go @@ -9,6 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( + "github.com/onsonr/sonr/pkg/nebula/components/home/sections" "github.com/onsonr/sonr/pkg/nebula/global/styles" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -46,7 +47,7 @@ func View(home *models.Home) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = Header().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Header().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,7 +55,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -62,7 +63,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Highlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Highlights().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -70,7 +71,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Features().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Features().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -78,7 +79,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Bento().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Bento().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -86,7 +87,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Lowlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Lowlights().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -94,7 +95,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = CallToAction().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.CallToAction().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,7 +103,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Footer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Footer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/profile/view.templ b/pkg/nebula/components/profile/view.templ deleted file mode 100644 index 103fde545..000000000 --- a/pkg/nebula/components/profile/view.templ +++ /dev/null @@ -1,15 +0,0 @@ -package profile - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -templ View(c echo.Context) { - @styles.Layout("Sonr.ID", true) { - @ui.Card("profile-view", styles.SizeLarge) { - @ui.ProfileCard() - } - } -} diff --git a/pkg/nebula/components/profile/view_templ.go b/pkg/nebula/components/profile/view_templ.go deleted file mode 100644 index e7a54b9bb..000000000 --- a/pkg/nebula/components/profile/view_templ.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package profile - -//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" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/global/styles" - "github.com/onsonr/sonr/pkg/nebula/global/ui" -) - -func View(c echo.Context) 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_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - 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_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - 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_Err = ui.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = ui.Card("profile-view", styles.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = styles.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/global/styles/layout.templ b/pkg/nebula/global/styles/layout.templ index 016443807..7d0addb56 100644 --- a/pkg/nebula/global/styles/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -49,3 +49,51 @@ templ LayoutNoBody(title string, remote bool) { } + + +templ Modal(title, description string) { +
+ +
+} diff --git a/pkg/nebula/global/styles/layout_templ.go b/pkg/nebula/global/styles/layout_templ.go index 2e67402b4..154a8cabe 100644 --- a/pkg/nebula/global/styles/layout_templ.go +++ b/pkg/nebula/global/styles/layout_templ.go @@ -140,4 +140,67 @@ func LayoutNoBody(title string, remote bool) templ.Component { }) } +func Modal(title, description 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_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/router/router.go b/pkg/nebula/router/router.go index cba66b45c..04242ff0d 100644 --- a/pkg/nebula/router/router.go +++ b/pkg/nebula/router/router.go @@ -6,10 +6,8 @@ import ( "github.com/a-h/templ" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/grant" "github.com/onsonr/sonr/pkg/nebula/components/home" "github.com/onsonr/sonr/pkg/nebula/components/login" - "github.com/onsonr/sonr/pkg/nebula/components/profile" "github.com/onsonr/sonr/pkg/nebula/components/register" "github.com/onsonr/sonr/pkg/nebula/models" ) @@ -26,16 +24,9 @@ func Home(c echo.Context) error { return render(c, home.View(mdls.Home)) } -func Profile(c echo.Context) error { - return render(c, profile.View(c)) -} - // ╭───────────────────────────────────────────────────────────╮ // │ Authentication Views │ // ╰───────────────────────────────────────────────────────────╯ -func Authorize(c echo.Context) error { - return render(c, grant.View(c)) -} func Login(c echo.Context) error { return render(c, login.Modal(c))