From 09e4d4d452555c77bbbc55b04bc042dead250c1f Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Wed, 27 Nov 2024 18:24:14 -0500 Subject: [PATCH] feat: add new button components and layout improvements --- deploy/testnet/devbox.lock | 203 ++++++++ pkg/webapp/components/button/buttons.templ | 15 + .../{ui => button}/buttons_templ.go | 50 +- pkg/webapp/components/layout/layout.templ | 59 +++ pkg/webapp/components/layout/layout_templ.go | 205 ++++++++ .../components/{ui => layout}/scripts.templ | 2 +- .../{ui => layout}/scripts_templ.go | 12 +- pkg/webapp/components/layout/ui.templ | 29 ++ pkg/webapp/components/layout/ui_templ.go | 159 ++++++ pkg/webapp/components/ui/buttons.templ | 31 -- pkg/webapp/components/ui/layout.templ | 182 ------- pkg/webapp/components/ui/layout_templ.go | 463 ------------------ pkg/webapp/components/view/view.templ | 87 ++++ pkg/webapp/components/view/view_templ.go | 112 +++++ .../pages/auth/internal/components.templ | 16 +- .../pages/auth/internal/components_templ.go | 2 +- pkg/webapp/pages/auth/page.templ | 9 +- pkg/webapp/pages/auth/page_templ.go | 9 +- pkg/webapp/pages/dash/page.templ | 7 +- pkg/webapp/pages/dash/page_templ.go | 7 +- pkg/webapp/pages/home/internal/hero.templ | 6 +- pkg/webapp/pages/home/internal/hero_templ.go | 6 +- pkg/webapp/pages/home/page.templ | 4 +- pkg/webapp/pages/home/page_templ.go | 4 +- pkg/webapp/pages/login/page.templ | 7 +- pkg/webapp/pages/login/page_templ.go | 7 +- pkg/webapp/pages/register/page.templ | 7 +- pkg/webapp/pages/register/page_templ.go | 7 +- 28 files changed, 941 insertions(+), 766 deletions(-) create mode 100644 deploy/testnet/devbox.lock create mode 100644 pkg/webapp/components/button/buttons.templ rename pkg/webapp/components/{ui => button}/buttons_templ.go (50%) create mode 100644 pkg/webapp/components/layout/layout.templ create mode 100644 pkg/webapp/components/layout/layout_templ.go rename pkg/webapp/components/{ui => layout}/scripts.templ (99%) rename pkg/webapp/components/{ui => layout}/scripts_templ.go (97%) create mode 100644 pkg/webapp/components/layout/ui.templ create mode 100644 pkg/webapp/components/layout/ui_templ.go delete mode 100644 pkg/webapp/components/ui/buttons.templ delete mode 100644 pkg/webapp/components/ui/layout.templ delete mode 100644 pkg/webapp/components/ui/layout_templ.go create mode 100644 pkg/webapp/components/view/view.templ create mode 100644 pkg/webapp/components/view/view_templ.go diff --git a/deploy/testnet/devbox.lock b/deploy/testnet/devbox.lock new file mode 100644 index 000000000..6d0c0e762 --- /dev/null +++ b/deploy/testnet/devbox.lock @@ -0,0 +1,203 @@ +{ + "lockfile_version": "1", + "packages": { + "air@latest": { + "last_modified": "2024-11-16T04:25:12Z", + "resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#air", + "source": "devbox-search", + "version": "1.61.1", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1", + "default": true + } + ], + "store_path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1", + "default": true + } + ], + "store_path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1", + "default": true + } + ], + "store_path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1", + "default": true + } + ], + "store_path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1" + } + } + }, + "bun@latest": { + "last_modified": "2024-11-18T00:41:09Z", + "resolved": "github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7#bun", + "source": "devbox-search", + "version": "1.1.34", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34", + "default": true + } + ], + "store_path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34", + "default": true + } + ], + "store_path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34", + "default": true + } + ], + "store_path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34", + "default": true + } + ], + "store_path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34" + } + } + }, + "go@1.22": { + "last_modified": "2024-11-16T04:25:12Z", + "resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#go_1_22", + "source": "devbox-search", + "version": "1.22.9", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/4nf51i4ah186y2jy3fad2fyvpa49qx6q-go-1.22.9", + "default": true + } + ], + "store_path": "/nix/store/4nf51i4ah186y2jy3fad2fyvpa49qx6q-go-1.22.9" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/8w8vzwgp55yl8j1ljgm4wzdgjkvkv5v3-go-1.22.9", + "default": true + } + ], + "store_path": "/nix/store/8w8vzwgp55yl8j1ljgm4wzdgjkvkv5v3-go-1.22.9" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/vlih7j78ki05i8nvzdsxvws7a7ksq04m-go-1.22.9", + "default": true + } + ], + "store_path": "/nix/store/vlih7j78ki05i8nvzdsxvws7a7ksq04m-go-1.22.9" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/frc5188kgv3ws0n999c7cy5vi2f8k4jp-go-1.22.9", + "default": true + } + ], + "store_path": "/nix/store/frc5188kgv3ws0n999c7cy5vi2f8k4jp-go-1.22.9" + } + } + }, + "ipfs@latest": { + "last_modified": "2023-02-24T09:01:09Z", + "resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs", + "source": "devbox-search", + "version": "0.17.0" + }, + "templ@latest": { + "last_modified": "2024-11-16T04:25:12Z", + "resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#templ", + "source": "devbox-search", + "version": "0.2.793", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793", + "default": true + } + ], + "store_path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793", + "default": true + } + ], + "store_path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793", + "default": true + } + ], + "store_path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793", + "default": true + } + ], + "store_path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793" + } + } + } + } +} diff --git a/pkg/webapp/components/button/buttons.templ b/pkg/webapp/components/button/buttons.templ new file mode 100644 index 000000000..04b164e37 --- /dev/null +++ b/pkg/webapp/components/button/buttons.templ @@ -0,0 +1,15 @@ +package button + +templ Primary(href string, text string) { +
+
+ { text } +
+
+} + +templ Secondary(href string, text string) { +
+
{ text }
+
+} diff --git a/pkg/webapp/components/ui/buttons_templ.go b/pkg/webapp/components/button/buttons_templ.go similarity index 50% rename from pkg/webapp/components/ui/buttons_templ.go rename to pkg/webapp/components/button/buttons_templ.go index e53fd6e65..096ad5425 100644 --- a/pkg/webapp/components/ui/buttons_templ.go +++ b/pkg/webapp/components/button/buttons_templ.go @@ -1,14 +1,14 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.793 -package ui +package button //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 { +func Primary(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 { @@ -36,7 +36,7 @@ func PrimaryButton(href string, text string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(href) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/buttons.templ`, Line: 5, Col: 124} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/button/buttons.templ`, Line: 5, Col: 124} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -49,7 +49,7 @@ func PrimaryButton(href string, text string) templ.Component { 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/webapp/components/ui/buttons.templ`, Line: 6, Col: 9} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/button/buttons.templ`, Line: 6, Col: 9} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -63,7 +63,7 @@ func PrimaryButton(href string, text string) templ.Component { }) } -func SecondaryButton(href string, text string) templ.Component { +func Secondary(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 { @@ -91,7 +91,7 @@ func SecondaryButton(href string, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/buttons.templ`, Line: 13, Col: 175} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/button/buttons.templ`, Line: 13, Col: 175} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -105,42 +105,4 @@ func SecondaryButton(href string, text string) templ.Component { }) } -type button struct { - variant Variant - hxGet string - hxPost string - hxTarget string - hxTrigger string - hxSwap string -} - -func GithubLoginButton() 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_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = 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/webapp/components/layout/layout.templ b/pkg/webapp/components/layout/layout.templ new file mode 100644 index 000000000..62d63d82e --- /dev/null +++ b/pkg/webapp/components/layout/layout.templ @@ -0,0 +1,59 @@ +package layout + +// Layout is a component that renders the general layout of the application +templ Root(title string, remote bool) { + + + + @Styles() + @Htmx() + @Alpine() + @WebAwesome() + + + + { title } + + + + + + + @Toaster() { +
+ { children... } +
+ } + + +} + +// LayoutNoBody is a component that renders the general layout of the application without the body tag +templ NoBody(title string, remote bool) { + + + + @Styles() + @Htmx() + @Alpine() + @WebAwesome() + + + + { title } + + + + + +
+ + @Toaster() { +
+ { children... } +
+ } + +
+ +} diff --git a/pkg/webapp/components/layout/layout_templ.go b/pkg/webapp/components/layout/layout_templ.go new file mode 100644 index 000000000..08ab09a1a --- /dev/null +++ b/pkg/webapp/components/layout/layout_templ.go @@ -0,0 +1,205 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.793 +package layout + +//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" + +// Layout is a component that renders the general layout of the application +func Root(title string, remote bool) 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 + } + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = WebAwesome().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 + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/layout.templ`, Line: 15, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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_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 = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.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 + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Toaster().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), 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 + } + return templ_7745c5c3_Err + }) +} + +// LayoutNoBody is a component that renders the general layout of the application without the body tag +func NoBody(title string, remote bool) 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 + } + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = WebAwesome().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 + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/layout.templ`, Line: 43, Col: 17} + } + _, 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("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var6 := 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 = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var4.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 + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Toaster().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), 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 + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/webapp/components/ui/scripts.templ b/pkg/webapp/components/layout/scripts.templ similarity index 99% rename from pkg/webapp/components/ui/scripts.templ rename to pkg/webapp/components/layout/scripts.templ index 38dafe6da..56a728b4e 100644 --- a/pkg/webapp/components/ui/scripts.templ +++ b/pkg/webapp/components/layout/scripts.templ @@ -1,4 +1,4 @@ -package ui +package layout const ( PublicOrigin = "https://cdn.sonr.id" diff --git a/pkg/webapp/components/ui/scripts_templ.go b/pkg/webapp/components/layout/scripts_templ.go similarity index 97% rename from pkg/webapp/components/ui/scripts_templ.go rename to pkg/webapp/components/layout/scripts_templ.go index 86e24b9d6..a49e30ab5 100644 --- a/pkg/webapp/components/ui/scripts_templ.go +++ b/pkg/webapp/components/layout/scripts_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.793 -package ui +package layout //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -47,7 +47,7 @@ func Styles() templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/css/styles.css") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/scripts.templ`, Line: 15, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/scripts.templ`, Line: 15, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -89,7 +89,7 @@ func Alpine() templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/alpine-focus.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/scripts.templ`, Line: 20, Col: 59} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/scripts.templ`, Line: 20, Col: 59} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -102,7 +102,7 @@ func Alpine() templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/alpine.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/scripts.templ`, Line: 21, Col: 53} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/scripts.templ`, Line: 21, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -144,7 +144,7 @@ func Dexie() templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/dexie.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/scripts.templ`, Line: 25, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/scripts.templ`, Line: 25, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -186,7 +186,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/htmx.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/scripts.templ`, Line: 29, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/scripts.templ`, Line: 29, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { diff --git a/pkg/webapp/components/layout/ui.templ b/pkg/webapp/components/layout/ui.templ new file mode 100644 index 000000000..bc847ec77 --- /dev/null +++ b/pkg/webapp/components/layout/ui.templ @@ -0,0 +1,29 @@ +package layout + +// Rows is a component that renders a flex container with a gap of 2 and a max width of 100% +templ Rows() { +
+ { children... } +
+} + +// Spacer is a component that renders a
tag +templ Spacer() { +
+} + +templ Separator(text string) { +
+
+
+ { text } +
+
+} + +// Columns is a component that renders a flex container with a gap of 3 and a max width of 100% +templ Columns() { +
+ { children... } +
+} diff --git a/pkg/webapp/components/layout/ui_templ.go b/pkg/webapp/components/layout/ui_templ.go new file mode 100644 index 000000000..91d3a4761 --- /dev/null +++ b/pkg/webapp/components/layout/ui_templ.go @@ -0,0 +1,159 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.793 +package layout + +//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" + +// Rows is a component that renders a flex container with a gap of 2 and a max width of 100% +func Rows() 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 + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.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 + } + return templ_7745c5c3_Err + }) +} + +// Spacer is a component that renders a
tag +func Spacer() 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = 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 + }) +} + +func Separator(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_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = 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_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/layout/ui.templ`, Line: 19, Col: 54} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + 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 + }) +} + +// Columns is a component that renders a flex container with a gap of 3 and a max width of 100% +func Columns() 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 + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.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 + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/webapp/components/ui/buttons.templ b/pkg/webapp/components/ui/buttons.templ deleted file mode 100644 index b4f23e3ef..000000000 --- a/pkg/webapp/components/ui/buttons.templ +++ /dev/null @@ -1,31 +0,0 @@ -package ui - -templ PrimaryButton(href string, text string) { -
-
- { text } -
-
-} - -templ SecondaryButton(href string, text string) { -
-
{ text }
-
-} - -type button struct { - variant Variant - hxGet string - hxPost string - hxTarget string - hxTrigger string - hxSwap string -} - -templ GithubLoginButton() { - -} diff --git a/pkg/webapp/components/ui/layout.templ b/pkg/webapp/components/ui/layout.templ deleted file mode 100644 index eee48dd03..000000000 --- a/pkg/webapp/components/ui/layout.templ +++ /dev/null @@ -1,182 +0,0 @@ -package ui - -// Variant is a component that has attributes -type Variant interface { - Attributes() templ.Attributes -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ General Layout Components │ -// ╰───────────────────────────────────────────────────────────╯ - -// Columns is a component that renders a flex container with a gap of 3 and a max width of 100% -templ Columns() { -
- { children... } -
-} - -// Layout is a component that renders the general layout of the application -templ Layout(title string, remote bool) { - - - - @Styles() - @Htmx() - @Alpine() - @WebAwesome() - - - - { title } - - - - - - - @Toaster() { -
- { children... } -
- } - - -} - -// LayoutNoBody is a component that renders the general layout of the application without the body tag -templ LayoutNoBody(title string, remote bool) { - - - - @Styles() - @Htmx() - @Alpine() - @WebAwesome() - - - - { title } - - - - - -
- - @Toaster() { -
- { children... } -
- } - -
- -} - -// OpenModal is a component that renders a modal with a title and description -templ OpenModal(title, description string) { -
- -
-} - -templ FullScreenModal() { -
- -
-} - -// Rows is a component that renders a flex container with a gap of 2 and a max width of 100% -templ Rows() { -
- { children... } -
-} - -// Spacer is a component that renders a
tag -templ Spacer() { -
-} - -templ Separator(text string) { -
-
-
- { text } -
-
-} diff --git a/pkg/webapp/components/ui/layout_templ.go b/pkg/webapp/components/ui/layout_templ.go deleted file mode 100644 index cba9dd2e4..000000000 --- a/pkg/webapp/components/ui/layout_templ.go +++ /dev/null @@ -1,463 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -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" - -// Variant is a component that has attributes -type Variant interface { - Attributes() templ.Attributes -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ General Layout Components │ -// ╰───────────────────────────────────────────────────────────╯ - -// Columns is a component that renders a flex container with a gap of 3 and a max width of 100% -func Columns() 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 - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.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 - } - return templ_7745c5c3_Err - }) -} - -// Layout is a component that renders the general layout of the application -func Layout(title string, remote bool) 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = WebAwesome().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 - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/layout.templ`, Line: 31, Col: 17} - } - _, 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 - } - templ_7745c5c3_Var4 := 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 = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var2.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 - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = Toaster().Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), 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 - } - return templ_7745c5c3_Err - }) -} - -// LayoutNoBody is a component that renders the general layout of the application without the body tag -func LayoutNoBody(title string, remote bool) 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 - } - templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = WebAwesome().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 - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/layout.templ`, Line: 59, Col: 17} - } - _, 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 - } - templ_7745c5c3_Var7 := 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 = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var5.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 - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = Toaster().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), 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 - } - return templ_7745c5c3_Err - }) -} - -// OpenModal is a component that renders a modal with a title and description -func OpenModal(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_Var8 := templ.GetChildren(ctx) - if templ_7745c5c3_Var8 == nil { - templ_7745c5c3_Var8 = 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 - }) -} - -func FullScreenModal() 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_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = 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 - }) -} - -// Rows is a component that renders a flex container with a gap of 2 and a max width of 100% -func Rows() 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_Var12 := templ.GetChildren(ctx) - if templ_7745c5c3_Var12 == nil { - templ_7745c5c3_Var12 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var12.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 - } - return templ_7745c5c3_Err - }) -} - -// Spacer is a component that renders a
tag -func Spacer() 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_Var13 := templ.GetChildren(ctx) - if templ_7745c5c3_Var13 == nil { - templ_7745c5c3_Var13 = 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 - }) -} - -func Separator(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_Var14 := templ.GetChildren(ctx) - if templ_7745c5c3_Var14 == nil { - templ_7745c5c3_Var14 = 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_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/webapp/components/ui/layout.templ`, Line: 179, Col: 54} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) - 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 diff --git a/pkg/webapp/components/view/view.templ b/pkg/webapp/components/view/view.templ new file mode 100644 index 000000000..dbecb7220 --- /dev/null +++ b/pkg/webapp/components/view/view.templ @@ -0,0 +1,87 @@ +package view + +// Modal is a component that renders a modal with a title and description +templ Modal(title, description string) { +
+ +
+} + +templ FullScreenModal() { +
+ +
+} diff --git a/pkg/webapp/components/view/view_templ.go b/pkg/webapp/components/view/view_templ.go new file mode 100644 index 000000000..c05aba538 --- /dev/null +++ b/pkg/webapp/components/view/view_templ.go @@ -0,0 +1,112 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.793 +package view + +//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" + +// Modal is a component that renders a modal with a title and description +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_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 + } + return templ_7745c5c3_Err + }) +} + +func FullScreenModal() 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 + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/webapp/pages/auth/internal/components.templ b/pkg/webapp/pages/auth/internal/components.templ index cef6a0802..b19279394 100644 --- a/pkg/webapp/pages/auth/internal/components.templ +++ b/pkg/webapp/pages/auth/internal/components.templ @@ -11,6 +11,18 @@ templ RegisterHeader() { } templ RegisterFooter() { -

Already have an account? Login here

-

By continuing, you agree to our Terms and Policy.

+

+ Already have an account? + + Login here + + +

+

+ By continuing, you agree to our + Terms and + + Policy + . +

} diff --git a/pkg/webapp/pages/auth/internal/components_templ.go b/pkg/webapp/pages/auth/internal/components_templ.go index d5cee3a77..1d7212cce 100644 --- a/pkg/webapp/pages/auth/internal/components_templ.go +++ b/pkg/webapp/pages/auth/internal/components_templ.go @@ -58,7 +58,7 @@ func RegisterFooter() templ.Component { templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Already have an account? Login here

By continuing, you agree to our Terms and Policy.

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Already have an account? Login here

By continuing, you agree to our Terms and Policy.

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/auth/page.templ b/pkg/webapp/pages/auth/page.templ index 09c4ac668..b4232c3a7 100644 --- a/pkg/webapp/pages/auth/page.templ +++ b/pkg/webapp/pages/auth/page.templ @@ -1,16 +1,17 @@ package login import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" - "github.com/onsonr/sonr/pkg/webapp/pages/login/internal" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" + "github.com/onsonr/sonr/pkg/webapp/pages/auth/internal" ) // RedirectModal returns the Modal with a QR code to scan. templ Page() { - @ui.FullScreenModal() { + @view.FullScreenModal() {
@internal.RegisterHeader() - @ui.Separator("Or Reserve Handle") + @layout.Separator("Or Reserve Handle") @internal.ReserveHandleForm()
@internal.RegisterFooter() diff --git a/pkg/webapp/pages/auth/page_templ.go b/pkg/webapp/pages/auth/page_templ.go index 11e2e7152..838697a60 100644 --- a/pkg/webapp/pages/auth/page_templ.go +++ b/pkg/webapp/pages/auth/page_templ.go @@ -9,8 +9,9 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" - "github.com/onsonr/sonr/pkg/webapp/pages/login/internal" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" + "github.com/onsonr/sonr/pkg/webapp/pages/auth/internal" ) // RedirectModal returns the Modal with a QR code to scan. @@ -55,7 +56,7 @@ func Page() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -73,7 +74,7 @@ func Page() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = ui.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = view.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/dash/page.templ b/pkg/webapp/pages/dash/page.templ index 837b022ac..f95cc3c59 100644 --- a/pkg/webapp/pages/dash/page.templ +++ b/pkg/webapp/pages/dash/page.templ @@ -1,16 +1,17 @@ package dash import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/dash/internal" ) // RedirectModal returns the Modal with a QR code to scan. templ Page() { - @ui.FullScreenModal() { + @view.FullScreenModal() {
@internal.RegisterHeader() - @ui.Separator("Or Reserve Handle") + @layout.Separator("Or Reserve Handle") @internal.ReserveHandleForm()
@internal.RegisterFooter() diff --git a/pkg/webapp/pages/dash/page_templ.go b/pkg/webapp/pages/dash/page_templ.go index 3124ac832..9e77f5a49 100644 --- a/pkg/webapp/pages/dash/page_templ.go +++ b/pkg/webapp/pages/dash/page_templ.go @@ -9,7 +9,8 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/dash/internal" ) @@ -55,7 +56,7 @@ func Page() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -73,7 +74,7 @@ func Page() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = ui.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = view.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/home/internal/hero.templ b/pkg/webapp/pages/home/internal/hero.templ index 5f87e5800..df03176ac 100644 --- a/pkg/webapp/pages/home/internal/hero.templ +++ b/pkg/webapp/pages/home/internal/hero.templ @@ -2,7 +2,7 @@ package internal import ( "fmt" - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/button" models "github.com/onsonr/sonr/pkg/webapp/models" ) @@ -20,8 +20,8 @@ templ Hero(hero *models.Hero) { { hero.Subtitle }

- @ui.PrimaryButton("/register", "Get Started") - @ui.SecondaryButton("/learn", "Learn More") + @button.Primary("/register", "Get Started") + @button.Secondary("/learn", "Learn More")
diff --git a/pkg/webapp/pages/home/internal/hero_templ.go b/pkg/webapp/pages/home/internal/hero_templ.go index e7fb4e15b..fd58eeb4e 100644 --- a/pkg/webapp/pages/home/internal/hero_templ.go +++ b/pkg/webapp/pages/home/internal/hero_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "fmt" - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/button" models "github.com/onsonr/sonr/pkg/webapp/models" ) @@ -61,11 +61,11 @@ func Hero(hero *models.Hero) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.PrimaryButton("/register", "Get Started").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = button.Primary("/register", "Get Started").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.SecondaryButton("/learn", "Learn More").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = button.Secondary("/learn", "Learn More").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/home/page.templ b/pkg/webapp/pages/home/page.templ index 8bce12225..bc558442d 100644 --- a/pkg/webapp/pages/home/page.templ +++ b/pkg/webapp/pages/home/page.templ @@ -2,13 +2,13 @@ package home import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" landing "github.com/onsonr/sonr/pkg/webapp/pages/home/internal" ) // View renders the home page templ Page() { - @ui.LayoutNoBody("Sonr.ID", true) { + @layout.NoBody("Sonr.ID", true) { @landing.Header(header) @landing.Hero(hero) @landing.Highlights(highlights) diff --git a/pkg/webapp/pages/home/page_templ.go b/pkg/webapp/pages/home/page_templ.go index c3776c013..611245897 100644 --- a/pkg/webapp/pages/home/page_templ.go +++ b/pkg/webapp/pages/home/page_templ.go @@ -10,7 +10,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" landing "github.com/onsonr/sonr/pkg/webapp/pages/home/internal" ) @@ -110,7 +110,7 @@ func Page() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = ui.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.NoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/login/page.templ b/pkg/webapp/pages/login/page.templ index 09c4ac668..452e981d6 100644 --- a/pkg/webapp/pages/login/page.templ +++ b/pkg/webapp/pages/login/page.templ @@ -1,16 +1,17 @@ package login import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/login/internal" ) // RedirectModal returns the Modal with a QR code to scan. templ Page() { - @ui.FullScreenModal() { + @view.FullScreenModal() {
@internal.RegisterHeader() - @ui.Separator("Or Reserve Handle") + @layout.Separator("Or Reserve Handle") @internal.ReserveHandleForm()
@internal.RegisterFooter() diff --git a/pkg/webapp/pages/login/page_templ.go b/pkg/webapp/pages/login/page_templ.go index 11e2e7152..3f253226d 100644 --- a/pkg/webapp/pages/login/page_templ.go +++ b/pkg/webapp/pages/login/page_templ.go @@ -9,7 +9,8 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/login/internal" ) @@ -55,7 +56,7 @@ func Page() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -73,7 +74,7 @@ func Page() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = ui.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = view.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/webapp/pages/register/page.templ b/pkg/webapp/pages/register/page.templ index 74a3739e0..33ca137f1 100644 --- a/pkg/webapp/pages/register/page.templ +++ b/pkg/webapp/pages/register/page.templ @@ -1,16 +1,17 @@ package register import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/register/internal" ) // RedirectModal returns the Modal with a QR code to scan. templ Page() { - @ui.FullScreenModal() { + @view.FullScreenModal() {
@internal.RegisterHeader() - @ui.Separator("Or Reserve Handle") + @layout.Separator("Or Reserve Handle") @internal.ReserveHandleForm()
@internal.RegisterFooter() diff --git a/pkg/webapp/pages/register/page_templ.go b/pkg/webapp/pages/register/page_templ.go index b79a1f24d..3396805b4 100644 --- a/pkg/webapp/pages/register/page_templ.go +++ b/pkg/webapp/pages/register/page_templ.go @@ -9,7 +9,8 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/webapp/components/ui" + "github.com/onsonr/sonr/pkg/webapp/components/layout" + "github.com/onsonr/sonr/pkg/webapp/components/view" "github.com/onsonr/sonr/pkg/webapp/pages/register/internal" ) @@ -55,7 +56,7 @@ func Page() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Separator("Or Reserve Handle").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -73,7 +74,7 @@ func Page() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = ui.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = view.FullScreenModal().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }