diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fa0ca80..62087d2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -4,7 +4,7 @@ project_name: hway builds: - id: hway - main: ./cmd + main: ./cmd/hway binary: hway goos: - linux @@ -20,6 +20,7 @@ builds: - -X main.version={{.Version}} - -X main.commit={{.Commit}} - -X main.date={{.Date}} + archives: - id: hway builds: [hway] @@ -54,7 +55,7 @@ nfpms: bindir: /usr/bin section: net priority: optional - # Add these lines to match build config + brews: - name: hway ids: [hway] @@ -77,7 +78,7 @@ release: github: owner: onsonr name: sonr - name_template: "{{ .Tag }} | {{ .Env.RELEASE_DATE }}" + name_template: "{{ .Tag }} [{{ .Env.RELEASE_DATE }}]" draft: false replace_existing_draft: true replace_existing_artifacts: true @@ -90,7 +91,6 @@ dockers: - onsonr/hway:latest - ghcr.io/onsonr/hway:{{ .Tag }} - ghcr.io/onsonr/hway:latest - dockerfile: ./docker/release.Dockerfile announce: telegram: diff --git a/docker/release.Dockerfile b/Dockerfile similarity index 100% rename from docker/release.Dockerfile rename to Dockerfile diff --git a/app/app.go b/app/app.go index 3de82bc..5a05557 100644 --- a/app/app.go +++ b/app/app.go @@ -1,4 +1,3 @@ -// Package gateway provides the default routes for the Sonr hway. package app import ( @@ -7,8 +6,9 @@ import ( echomiddleware "github.com/labstack/echo/v4/middleware" "github.com/onsonr/hway/pkg/common" config "github.com/onsonr/hway/pkg/config" + "github.com/onsonr/hway/pkg/context" hwayorm "github.com/onsonr/hway/pkg/models" - // "github.com/onsonr/hway/pkg/context" + "github.com/onsonr/hway/x/landing" ) type Gateway = *echo.Echo @@ -22,11 +22,11 @@ func New(env config.Hway, ipc common.IPFS, dbq *hwayorm.Queries) (Gateway, error e.Use(echomiddleware.Recover()) e.IPExtractor = echo.ExtractIPDirect() e.Use(echoprometheus.NewMiddleware("hway")) - // e.Use(context.UseGateway(env, ipc, dbq)) - // Register View Handlers - // e.HTTPErrorHandler = handlers.ErrorHandler - // e.GET("/", handlers.IndexHandler) - // handlers.RegisterHandler(e.Group("/register")) + // Use the gateway middleware + e.Use(context.UseGateway(env, ipc, dbq)) + + // Add Module Routes + landing.RegisterRoutes(e) return e, nil } diff --git a/app/islands/card_account.templ b/app/islands/card_account.templ deleted file mode 100644 index 76e7b8c..0000000 --- a/app/islands/card_account.templ +++ /dev/null @@ -1,38 +0,0 @@ -package islands - -templ CardAccount(addr, name, handle, creationBlock string) { -
-
-
-
-

sonr-testnet-1

-

{ handle }

-
-
- -
-
-
- { shortenAddress(addr) } -
-
-
-

Block Created

-

#{ creationBlock }

-
-
-

Issued to

-

{ name }

-
-
-
-
-} - -// Helper function to shorten address -func shortenAddress(address string) string { - if len(address) <= 20 { - return address - } - return address[:16] + "..." + address[len(address)-4:] -} diff --git a/app/islands/card_account_templ.go b/app/islands/card_account_templ.go deleted file mode 100644 index 2654cbe..0000000 --- a/app/islands/card_account_templ.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package islands - -//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 CardAccount(addr, name, handle, creationBlock 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

sonr-testnet-1

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(handle) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/card_account.templ`, Line: 9, Col: 43} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(shortenAddress(addr)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/card_account.templ`, Line: 16, Col: 58} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "

Block Created

#") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(creationBlock) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/card_account.templ`, Line: 21, Col: 55} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "

Issued to

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/card_account.templ`, Line: 25, Col: 32} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Helper function to shorten address -func shortenAddress(address string) string { - if len(address) <= 20 { - return address - } - return address[:16] + "..." + address[len(address)-4:] -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/islands/coin_select.templ b/app/islands/coin_select.templ deleted file mode 100644 index e16e7fb..0000000 --- a/app/islands/coin_select.templ +++ /dev/null @@ -1,70 +0,0 @@ -package islands - -type Coin struct { - Ticker string - Name string - IsDefault bool -} - -var defaultCoins = []Coin{ - {Ticker: "SNR", Name: "Sonr", IsDefault: true}, - {Ticker: "BTC", Name: "Bitcoin", IsDefault: true}, - {Ticker: "ETH", Name: "Ethereum", IsDefault: true}, - {Ticker: "SOL", Name: "Solana", IsDefault: false}, - {Ticker: "LTC", Name: "Litecoin", IsDefault: false}, - {Ticker: "DOGE", Name: "Dogecoin", IsDefault: false}, - {Ticker: "XRP", Name: "Ripple", IsDefault: false}, - {Ticker: "OSMO", Name: "Osmosis", IsDefault: false}, - {Ticker: "ATOM", Name: "Cosmos", IsDefault: false}, - {Ticker: "STARZ", Name: "Stargaze", IsDefault: false}, - {Ticker: "AKT", Name: "Akash", IsDefault: false}, - {Ticker: "EVMOS", Name: "Evmos", IsDefault: false}, - {Ticker: "FIL", Name: "Filecoin", IsDefault: false}, - {Ticker: "AXL", Name: "Axelar", IsDefault: false}, -} - -templ CoinSelect() { - - for _, a := range defaultCoins { - @CoinOption(a) - } - - -} - -templ CoinOption(a Coin) { - if a.IsDefault { - - - { a.Name } - - - } else { - - - { a.Name } - - - } -} diff --git a/app/islands/coin_select_templ.go b/app/islands/coin_select_templ.go deleted file mode 100644 index 1385382..0000000 --- a/app/islands/coin_select_templ.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package islands - -//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" - -type Coin struct { - Ticker string - Name string - IsDefault bool -} - -var defaultCoins = []Coin{ - {Ticker: "SNR", Name: "Sonr", IsDefault: true}, - {Ticker: "BTC", Name: "Bitcoin", IsDefault: true}, - {Ticker: "ETH", Name: "Ethereum", IsDefault: true}, - {Ticker: "SOL", Name: "Solana", IsDefault: false}, - {Ticker: "LTC", Name: "Litecoin", IsDefault: false}, - {Ticker: "DOGE", Name: "Dogecoin", IsDefault: false}, - {Ticker: "XRP", Name: "Ripple", IsDefault: false}, - {Ticker: "OSMO", Name: "Osmosis", IsDefault: false}, - {Ticker: "ATOM", Name: "Cosmos", IsDefault: false}, - {Ticker: "STARZ", Name: "Stargaze", IsDefault: false}, - {Ticker: "AKT", Name: "Akash", IsDefault: false}, - {Ticker: "EVMOS", Name: "Evmos", IsDefault: false}, - {Ticker: "FIL", Name: "Filecoin", IsDefault: false}, - {Ticker: "AXL", Name: "Axelar", IsDefault: false}, -} - -func CoinSelect() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - for _, a := range defaultCoins { - templ_7745c5c3_Err = CoinOption(a).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func CoinOption(a Coin) 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) - if a.IsDefault { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/coin_select.templ`, Line: 60, Col: 11} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/islands/coin_select.templ`, Line: 66, Col: 11} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/islands/human_slider.templ b/app/islands/human_slider.templ deleted file mode 100644 index ba5677c..0000000 --- a/app/islands/human_slider.templ +++ /dev/null @@ -1,25 +0,0 @@ -package islands - -import "fmt" - -templ HumanSlider(firstNumber int, lastNumber int) { -
- -
-} - -templ HumanSliderError(firstNumber int, lastNumber int) { - -
- - Invalid Human Sum -
-} - -templ HumanSliderSuccess() { - -} - -func humanLabel(firstNumber int, lastNumber int) string { - return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber) -} diff --git a/app/islands/human_slider_templ.go b/app/islands/human_slider_templ.go deleted file mode 100644 index 395dc40..0000000 --- a/app/islands/human_slider_templ.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package islands - -//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 "fmt" - -func HumanSlider(firstNumber int, lastNumber int) 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func HumanSliderError(firstNumber int, lastNumber int) 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
Invalid Human Sum
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func HumanSliderSuccess() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func humanLabel(firstNumber int, lastNumber int) string { - return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/islands/input_handle.templ b/app/islands/input_handle.templ deleted file mode 100644 index 12aa645..0000000 --- a/app/islands/input_handle.templ +++ /dev/null @@ -1,45 +0,0 @@ -package islands - -type HandleState string - -const ( - HandleStateInitial HandleState = "inital" - HandleStateValid HandleState = "valid" - HandleStateInvalid HandleState = "invalid" -) - -func (s HandleState) string() string { - return string(s) -} - -templ InputHandle() { -
- -
- -
-
-
-
-} - -templ InputHandleError(value string, helpText string) { - -
- -
-
- -
-
-
-} - -templ InputHandleSuccess(value string) { - -
- -
-
-
-} diff --git a/app/islands/input_handle_templ.go b/app/islands/input_handle_templ.go deleted file mode 100644 index 9ed4b09..0000000 --- a/app/islands/input_handle_templ.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package islands - -//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" - -type HandleState string - -const ( - HandleStateInitial HandleState = "inital" - HandleStateValid HandleState = "valid" - HandleStateInvalid HandleState = "invalid" -) - -func (s HandleState) string() string { - return string(s) -} - -func InputHandle() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func InputHandleError(value string, helpText 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_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func InputHandleSuccess(value 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/islands/input_passkey.templ b/app/islands/input_passkey.templ deleted file mode 100644 index 094a13b..0000000 --- a/app/islands/input_passkey.templ +++ /dev/null @@ -1,97 +0,0 @@ -package islands - -templ InputPasskey(addr string, userHandle string, challenge string) { - - - Register Passkey - -} - -script navigatorCredentialsCreate(userId string, userHandle string, challenge string) { - const publicKey = { - challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)), - rp: { - name: "Sonr.ID", - }, - user: { - // Assuming that userId is ASCII-only - id: Uint8Array.from(userId, (c) => c.charCodeAt(0)), - name: userId, - displayName: userHandle, - }, - pubKeyCredParams: [ - { - type: "public-key", - alg: -7, // "ES256" - }, - { - type: "public-key", - alg: -257, // "RS256" - }, - ], - authenticatorSelection: { - userVerification: "required", - residentKey: "required", - authenticatorAttachment: "platform", - }, - timeout: 60000, // 1 minute - extensions: { - payment: { - isPayment: true, - }, - largeBlob: { - supported: "preferred", - }, - }, - }; - - // Helper function to convert ArrayBuffer to Base64URL string - function arrayBufferToBase64URL(buffer) { - const bytes = new Uint8Array(buffer); - let str = ''; - bytes.forEach(byte => { str += String.fromCharCode(byte) }); - return btoa(str) - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); - } - -navigator.credentials - .create({ publicKey }) - .then((newCredentialInfo) => { - if (!(newCredentialInfo instanceof PublicKeyCredential)) { - throw new Error('Received credential is not a PublicKeyCredential'); - } - - const response = newCredentialInfo.response; - if (!(response instanceof AuthenticatorAttestationResponse)) { - throw new Error('Response is not an AuthenticatorAttestationResponse'); - } - - // Convert the credential data to a cross-platform compatible format - const credentialJSON = { - id: newCredentialInfo.id, - rawId: arrayBufferToBase64URL(newCredentialInfo.rawId), - type: newCredentialInfo.type, - authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null, - transports: Array.isArray(response.getTransports) ? response.getTransports() : [], - clientExtensionResults: newCredentialInfo.getClientExtensionResults(), - response: { - attestationObject: arrayBufferToBase64URL(response.attestationObject), - clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON) - } - }; - - // Set the form value with the stringified credential data - const credential = document.getElementById('credential-data'); - credential.value = JSON.stringify(credentialJSON); - - // Submit the form - const form = document.getElementById('passkey-form'); - form.submit(); - }) - .catch((err) => { - console.error('Passkey creation failed:', err); - alert(`Failed to create passkey: ${err.message || 'Unknown error'}`); - }); -} diff --git a/app/islands/input_passkey_templ.go b/app/islands/input_passkey_templ.go deleted file mode 100644 index 0960225..0000000 --- a/app/islands/input_passkey_templ.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package islands - -//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 InputPasskey(addr string, userHandle string, challenge 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, navigatorCredentialsCreate(addr, userHandle, challenge)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " Register Passkey") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func navigatorCredentialsCreate(userId string, userHandle string, challenge string) templ.ComponentScript { - return templ.ComponentScript{ - Name: `__templ_navigatorCredentialsCreate_63c0`, - Function: `function __templ_navigatorCredentialsCreate_63c0(userId, userHandle, challenge){const publicKey = { - challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)), - rp: { - name: "Sonr.ID", - }, - user: { - // Assuming that userId is ASCII-only - id: Uint8Array.from(userId, (c) => c.charCodeAt(0)), - name: userId, - displayName: userHandle, - }, - pubKeyCredParams: [ - { - type: "public-key", - alg: -7, // "ES256" - }, - { - type: "public-key", - alg: -257, // "RS256" - }, - ], - authenticatorSelection: { - userVerification: "required", - residentKey: "required", - authenticatorAttachment: "platform", - }, - timeout: 60000, // 1 minute - extensions: { - payment: { - isPayment: true, - }, - largeBlob: { - supported: "preferred", - }, - }, - }; - - // Helper function to convert ArrayBuffer to Base64URL string - function arrayBufferToBase64URL(buffer) { - const bytes = new Uint8Array(buffer); - let str = ''; - bytes.forEach(byte => { str += String.fromCharCode(byte) }); - return btoa(str) - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); - } - -navigator.credentials - .create({ publicKey }) - .then((newCredentialInfo) => { - if (!(newCredentialInfo instanceof PublicKeyCredential)) { - throw new Error('Received credential is not a PublicKeyCredential'); - } - - const response = newCredentialInfo.response; - if (!(response instanceof AuthenticatorAttestationResponse)) { - throw new Error('Response is not an AuthenticatorAttestationResponse'); - } - - // Convert the credential data to a cross-platform compatible format - const credentialJSON = { - id: newCredentialInfo.id, - rawId: arrayBufferToBase64URL(newCredentialInfo.rawId), - type: newCredentialInfo.type, - authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null, - transports: Array.isArray(response.getTransports) ? response.getTransports() : [], - clientExtensionResults: newCredentialInfo.getClientExtensionResults(), - response: { - attestationObject: arrayBufferToBase64URL(response.attestationObject), - clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON) - } - }; - - // Set the form value with the stringified credential data - const credential = document.getElementById('credential-data'); - credential.value = JSON.stringify(credentialJSON); - - // Submit the form - const form = document.getElementById('passkey-form'); - form.submit(); - }) - .catch((err) => { - console.error('Passkey creation failed:', err); - alert(` + "`" + `Failed to create passkey: ${err.message || 'Unknown error'}` + "`" + `); - }); -}`, - Call: templ.SafeScript(`__templ_navigatorCredentialsCreate_63c0`, userId, userHandle, challenge), - CallInline: templ.SafeScriptInline(`__templ_navigatorCredentialsCreate_63c0`, userId, userHandle, challenge), - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/views/base_form.templ b/app/views/base_form.templ deleted file mode 100644 index df0040b..0000000 --- a/app/views/base_form.templ +++ /dev/null @@ -1,58 +0,0 @@ -package views - -templ Form(action, id string) { -
- { children... } -
-} - -templ FormHeader() { -
-
- { children... } -
-
-} - -templ FormBody() { - - { children... } - - -} - -templ FormFooter() { -
- { children... } -
-} - -templ FormCancel() { - - - Cancel - -} - -templ FormSubmit(text string) { - - { text } - - -} diff --git a/app/views/base_form_templ.go b/app/views/base_form_templ.go deleted file mode 100644 index 7fad913..0000000 --- a/app/views/base_form_templ.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package views - -//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 Form(action, id 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func FormHeader() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func FormBody() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func FormFooter() 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_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func FormCancel() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " Cancel") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func FormSubmit(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_Var9 := templ.GetChildren(ctx) - if templ_7745c5c3_Var9 == nil { - templ_7745c5c3_Var9 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/views/base_form.templ`, Line: 55, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/views/base_head.templ b/app/views/base_head.templ deleted file mode 100644 index ab385ce..0000000 --- a/app/views/base_head.templ +++ /dev/null @@ -1,135 +0,0 @@ -package views - -import "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -templ Head(title string, nebulaVersion string) { - - @Turnstile() - @Tailwind() - @Alpine() - @Htmx() - @Dexie() - @Nebula(nebulaVersion) - - - - { title } - - - - - - { children... } - -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -templ Tailwind() { - @tailwindHandle.Once() { - - - } -} - -// Turnstile is used for cloudflare challenges -templ Turnstile() { - @turnstileHandle.Once() { - - } -} - -// Alpine is a component that renders the Alpine.js library -templ Alpine() { - @alpineHandle.Once() { - - - } -} - -// Dexie is a component that renders the Dexie.js library -templ Dexie() { - @dexieHandle.Once() { - - - } -} - -// Htmx is a component that renders the Htmx.js library -templ Htmx() { - @htmxHandle.Once() { - - - - - - - } -} - -// Nebula is a component that renders the Nebula.js library -templ Nebula(version string) { - - - @nebulaHandle.Once() { - - } -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} diff --git a/app/views/base_head_templ.go b/app/views/base_head_templ.go deleted file mode 100644 index 99ec4a5..0000000 --- a/app/views/base_head_templ.go +++ /dev/null @@ -1,573 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package views - -//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 "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -func Head(title string, nebulaVersion 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Turnstile().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Tailwind().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 = Htmx().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Dexie().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Nebula(nebulaVersion).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "") - 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: `app/views/base_head.templ`, Line: 25, Col: 16} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -func Tailwind() 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_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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = tailwindHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Turnstile is used for cloudflare challenges -func Turnstile() 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_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 = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = turnstileHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Alpine is a component that renders the Alpine.js library -func Alpine() 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_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var8 := 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = alpineHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Dexie is a component that renders the Dexie.js library -func Dexie() 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_Var12 := 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = dexieHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Htmx is a component that renders the Htmx.js library -func Htmx() 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_Var15 := templ.GetChildren(ctx) - if templ_7745c5c3_Var15 == nil { - templ_7745c5c3_Var15 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var16 := 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = htmxHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Nebula is a component that renders the Nebula.js library -func Nebula(version 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_Var23 := templ.GetChildren(ctx) - if templ_7745c5c3_Var23 == nil { - templ_7745c5c3_Var23 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var26 := 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = nebulaHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/views/base_hero.templ b/app/views/base_hero.templ deleted file mode 100644 index aaa3315..0000000 --- a/app/views/base_hero.templ +++ /dev/null @@ -1,36 +0,0 @@ -package views - -templ HeroTitle(title string, subtitle string) { -
-

- { title } -

-

- { subtitle } -

-
-} - -templ HeroStart() { -
- - - Create Vault - - -
-} - -templ HeroSocials() { -
- - - - - - - - - -
-} diff --git a/app/views/base_hero_templ.go b/app/views/base_hero_templ.go deleted file mode 100644 index f2c2d65..0000000 --- a/app/views/base_hero_templ.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package views - -//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 HeroTitle(title string, subtitle 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

") - 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: `app/views/base_hero.templ`, Line: 6, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(subtitle) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/views/base_hero.templ`, Line: 9, Col: 13} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func HeroStart() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
Create Vault
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func HeroSocials() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/views/base_layout.templ b/app/views/base_layout.templ deleted file mode 100644 index 17cadae..0000000 --- a/app/views/base_layout.templ +++ /dev/null @@ -1,59 +0,0 @@ -package views - -templ LayoutContainer() { -
-
-
-
- { children... } -
-
-
-
-} - -// Columns is a component that renders a responsive flex container that stacks on mobile -templ LayoutColumns() { -
- { children... } -
-} - -// Rows is a component that renders a responsive flex container that wraps on mobile -templ LayoutRows() { -
- { children... } -
-} - -templ LayoutSeparator(text string) { -
-
-
- { text } -
-
-} - -// Layout is a component that renders the general layout of the application -templ LayoutView(title string) { - - - @Head(title, "0.0.11") - -
- { children... } -
- - -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} diff --git a/app/views/base_layout_templ.go b/app/views/base_layout_templ.go deleted file mode 100644 index c3e8225..0000000 --- a/app/views/base_layout_templ.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.819 -package views - -//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 LayoutContainer() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Columns is a component that renders a responsive flex container that stacks on mobile -func LayoutColumns() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Rows is a component that renders a responsive flex container that wraps on mobile -func LayoutRows() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func LayoutSeparator(text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - 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: `app/views/base_layout.templ`, Line: 33, Col: 45} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Layout is a component that renders the general layout of the application -func LayoutView(title 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_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Head(title, "0.0.11").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/views/view_errors.templ b/app/views/view_errors.templ deleted file mode 100644 index 269b7ec..0000000 --- a/app/views/view_errors.templ +++ /dev/null @@ -1,14 +0,0 @@ -package views - -templ ErrorView(err string) { - @LayoutView("Error | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Uh oh!", "Something went wrong.") -
-

- { err } -

-
- } - } -} diff --git a/app/views/view_loading.templ b/app/views/view_loading.templ deleted file mode 100644 index 9418b23..0000000 --- a/app/views/view_loading.templ +++ /dev/null @@ -1,9 +0,0 @@ -package views - -templ LoadingView() { - @LayoutView("Loading... | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Loading Vault", "This will be used to login to your vault.") - } - } -} diff --git a/app/views/view_register.templ b/app/views/view_register.templ deleted file mode 100644 index abc784c..0000000 --- a/app/views/view_register.templ +++ /dev/null @@ -1,47 +0,0 @@ -package views - -import "github.com/onsonr/hway/app/islands" - -templ RegisterProfileView(firstNumber int, lastNumber int) { - @LayoutView("New Profile | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Basic Info", "Tell us a little about yourself.") - @Form("/register/passkey", "create-profile") { - @FormBody() { - @FormHeader() { -
- -
- } - @islands.InputHandle() - @islands.HumanSlider(firstNumber, lastNumber) - @FormFooter() { - @FormCancel() - @FormSubmit("Next") - } - } - } - } - } -} - -templ RegisterPasskeyView(address string, handle string, name string, challenge string, creationBlock string) { - @LayoutView("Register | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Link a PassKey", "This will be used to login to your vault.") - @Form("/register/finish", "passkey-form") { - - @FormBody() { - @FormHeader() { - @islands.CardAccount(address, name, handle, creationBlock) - } - @islands.CoinSelect() - @FormFooter() { - @islands.InputPasskey(address, handle, challenge) - @FormCancel() - } - } - } - } - } -} diff --git a/docker/sync.Dockerfile b/docker/sync.Dockerfile deleted file mode 100644 index 0f669b7..0000000 --- a/docker/sync.Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM docker.io/golang:1.20-alpine AS base - -WORKDIR /build -RUN mkdir -p /out -RUN apk --update --no-cache add build-base git -ARG GIT_SOURCE_REPO="https://github.com/matrix-org/sliding-sync.git" -ARG GIT_SOURCE_BRANCH="main" - -RUN git clone ${GIT_SOURCE_REPO} . - -ARG BINARYNAME=syncv3 -RUN go build -o /out/syncv3 "./cmd/$BINARYNAME" - -FROM alpine:3.17 - -RUN apk --update --no-cache add curl -COPY --from=base /out/* /usr/bin/ - -ENV SYNCV3_SERVER="https://sonr.chat" -ENV SYNCV3_DB="postgresql://neondb_owner:4zHmfZpEB6wQ@ep-square-wildflower-a52z3tuw.us-east-2.aws.neon.tech/neondb?sslmode=require" -ENV SYNCV3_SECRET="d1caeb5d86bee467e51a8650aa44e21ad68103d9495872015fbd36c0b9de4957" -ENV SYNCV3_BINDADDR="0.0.0.0:8008" - -EXPOSE 8008 - -WORKDIR /usr/bin -# It would be nice if the binary we exec was called $BINARYNAME here, but build args -# aren't expanded in ENTRYPOINT directives. Instead, we always call the output binary -# "syncv3". (See https://github.com/moby/moby/issues/18492) -ENTRYPOINT /usr/bin/syncv3 diff --git a/go.mod b/go.mod index 42494ca..7ad4b91 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/labstack/echo-contrib v0.17.2 github.com/labstack/echo/v4 v4.13.3 github.com/medama-io/go-useragent v1.0.1 + github.com/onsonr/nebula v0.1.3 github.com/onsonr/sonr v0.6.3 github.com/segmentio/ksuid v1.0.4 github.com/spf13/cobra v1.8.1 diff --git a/go.sum b/go.sum index 5aae3a1..446d0ee 100644 --- a/go.sum +++ b/go.sum @@ -748,6 +748,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/onsonr/nebula v0.1.3 h1:reyIHJ7K85Z7U4qC5WiJAFn8nd3a06mEiygR0obDVP4= +github.com/onsonr/nebula v0.1.3/go.mod h1:1Dcmw5lB4dvKRKSp55B/iLmN4ejZ4vp1/EB/RzXetAQ= github.com/onsonr/sonr v0.6.3 h1:KFjo1LNYPevB7vqn50q7ZI15Cgd3Vq5oQO6Sd/i3G7g= github.com/onsonr/sonr v0.6.3/go.mod h1:zNoLbYTYyIXbGngyMmbB3Iwh/WJyy4R6YDHJFuKFexA= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= diff --git a/handlers/login.go b/handlers/login.go deleted file mode 100644 index 5ac8282..0000000 --- a/handlers/login.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/pkg/context/renderer.go b/pkg/context/renderer.go index 113625e..1f920c3 100644 --- a/pkg/context/renderer.go +++ b/pkg/context/renderer.go @@ -5,7 +5,6 @@ import ( "github.com/a-h/templ" "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/views" ) func Render(c echo.Context, cmp templ.Component) error { @@ -28,15 +27,3 @@ func Render(c echo.Context, cmp templ.Component) error { c.Response().WriteHeader(200) return nil } - -func RenderError(c echo.Context, err error) error { - return Render(c, views.ErrorView(err.Error())) -} - -func RenderInitial(c echo.Context) error { - return Render(c, views.InitialView()) -} - -func RenderLoading(c echo.Context) error { - return Render(c, views.LoadingView()) -} diff --git a/x/errors/handler.go b/x/errors/handler.go deleted file mode 100644 index 04b3218..0000000 --- a/x/errors/handler.go +++ /dev/null @@ -1 +0,0 @@ -package errors diff --git a/x/errors/route.go b/x/errors/route.go deleted file mode 100644 index 04b3218..0000000 --- a/x/errors/route.go +++ /dev/null @@ -1 +0,0 @@ -package errors diff --git a/x/index/handler.go b/x/index/handler.go deleted file mode 100644 index 60a0228..0000000 --- a/x/index/handler.go +++ /dev/null @@ -1 +0,0 @@ -package index diff --git a/x/index/route.go b/x/index/route.go deleted file mode 100644 index 60a0228..0000000 --- a/x/index/route.go +++ /dev/null @@ -1 +0,0 @@ -package index diff --git a/handlers/errors.go b/x/landing/handlers/handle_errors.go similarity index 76% rename from handlers/errors.go rename to x/landing/handlers/handle_errors.go index 55a3b39..9135fbc 100644 --- a/handlers/errors.go +++ b/x/landing/handlers/handle_errors.go @@ -3,6 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/onsonr/hway/pkg/context" + "github.com/onsonr/hway/x/landing/views" ) func ErrorHandler(err error, c echo.Context) { @@ -10,7 +11,7 @@ func ErrorHandler(err error, c echo.Context) { if he.Code == 500 { // Log the error if needed c.Logger().Errorf("Error: %v", he.Message) - context.RenderError(c, he) + context.Render(c, views.ErrorView(he.Error())) } } } diff --git a/handlers/index.go b/x/landing/handlers/handle_index.go similarity index 70% rename from handlers/index.go rename to x/landing/handlers/handle_index.go index 0958e16..84612ea 100644 --- a/handlers/index.go +++ b/x/landing/handlers/handle_index.go @@ -3,6 +3,7 @@ package handlers import ( "github.com/labstack/echo/v4" "github.com/onsonr/hway/pkg/context" + "github.com/onsonr/hway/x/landing/views" ) func IndexHandler(c echo.Context) error { @@ -10,5 +11,5 @@ func IndexHandler(c echo.Context) error { if id == "" { context.NewSession(c) } - return context.RenderInitial(c) + return context.Render(c, views.InitialView()) } diff --git a/handlers/register.go b/x/landing/handlers/handle_register.go similarity index 83% rename from handlers/register.go rename to x/landing/handlers/handle_register.go index 296ed50..8a8d44f 100644 --- a/handlers/register.go +++ b/x/landing/handlers/handle_register.go @@ -4,11 +4,12 @@ import ( "encoding/json" "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/islands" - "github.com/onsonr/hway/app/views" "github.com/onsonr/hway/pkg/common" "github.com/onsonr/hway/pkg/context" + "github.com/onsonr/nebula/ui/input" + hwayorm "github.com/onsonr/hway/pkg/models" + "github.com/onsonr/hway/x/landing/views" ) func RegisterHandler(g *echo.Group) { @@ -47,7 +48,7 @@ func renderPasskeyForm(c echo.Context) error { params, err := cc.Spawn(handle, origin) if err != nil { - return context.RenderError(c, err) + return context.Render(c, views.ErrorView(err.Error())) } return context.Render(c, views.RegisterPasskeyView(params.Address, params.Handle, params.Name, params.Challenge, params.CreationBlock)) } @@ -63,27 +64,27 @@ func renderVaultStatus(c echo.Context) error { func validateProfileForm(c echo.Context) error { cc, err := context.GetGateway(c) if err != nil { - return context.RenderError(c, err) + return context.Render(c, views.ErrorView(err.Error())) } handle := c.FormValue("handle") if handle == "" { - return context.Render(c, islands.InputHandleError(handle, "Please enter a 4-16 character handle")) + return context.Render(c, input.HandleError(handle, "Please enter a 4-16 character handle")) } notok, err := cc.CheckHandleExists(context.BG(), handle) if err != nil { return err } if notok { - return context.Render(c, islands.InputHandleError(handle, "Handle is already taken")) + return context.Render(c, input.HandleError(handle, "Handle is already taken")) } cc.WriteCookie(common.UserHandle, handle) - return context.Render(c, islands.InputHandleSuccess(handle)) + return context.Render(c, input.HandleSuccess(handle)) } func validatePasskeyForm(c echo.Context) error { cc, err := context.GetGateway(c) if err != nil { - return context.RenderError(c, err) + return context.Render(c, views.ErrorView(err.Error())) } handle := context.GetProfileHandle(c) origin := c.Request().Host @@ -93,7 +94,7 @@ func validatePasskeyForm(c echo.Context) error { // Unmarshal the credential JSON err = json.Unmarshal([]byte(credentialJSON), cred) if err != nil { - return context.RenderError(c, err) + return context.Render(c, views.ErrorView(err.Error())) } md := cred.ToModel(handle, origin) @@ -105,7 +106,7 @@ func validatePasskeyForm(c echo.Context) error { Transports: md.Transports, }) if err != nil { - return context.RenderError(c, err) + return context.Render(c, views.ErrorView(err.Error())) } return context.Render(c, views.LoadingView()) } diff --git a/x/landing/routes.go b/x/landing/routes.go new file mode 100644 index 0000000..5125bb0 --- /dev/null +++ b/x/landing/routes.go @@ -0,0 +1,13 @@ +package landing + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/hway/x/landing/handlers" +) + +func RegisterRoutes(e *echo.Echo) { + e.HTTPErrorHandler = handlers.ErrorHandler + + e.GET("/", handlers.IndexHandler) + handlers.RegisterHandler(e.Group("/register")) +} diff --git a/x/landing/views/errors.templ b/x/landing/views/errors.templ new file mode 100644 index 0000000..d1c3fa3 --- /dev/null +++ b/x/landing/views/errors.templ @@ -0,0 +1,19 @@ +package views + +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + +templ ErrorView(err string) { + @layout.Root("Error | Sonr.ID") { + @layout.Container() { + @hero.Title("Uh oh!", "Something went wrong.") +
+

+ { err } +

+
+ } + } +} diff --git a/app/views/view_errors_templ.go b/x/landing/views/errors_templ.go similarity index 86% rename from app/views/view_errors_templ.go rename to x/landing/views/errors_templ.go index 9a25970..248cba8 100644 --- a/app/views/view_errors_templ.go +++ b/x/landing/views/errors_templ.go @@ -8,6 +8,11 @@ package views import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + func ErrorView(err 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 @@ -53,7 +58,7 @@ func ErrorView(err string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Uh oh!", "Something went wrong.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Uh oh!", "Something went wrong.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -64,7 +69,7 @@ func ErrorView(err string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(err) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/views/view_errors.templ`, Line: 9, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/landing/views/errors.templ`, Line: 14, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -76,13 +81,13 @@ func ErrorView(err string) templ.Component { } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("Error | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Error | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/app/views/view_home.templ b/x/landing/views/home.templ similarity index 51% rename from app/views/view_home.templ rename to x/landing/views/home.templ index df2ec47..5b9ceff 100644 --- a/app/views/view_home.templ +++ b/x/landing/views/home.templ @@ -1,19 +1,24 @@ package views +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + templ InitialView() { - @LayoutView("Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Sonr.ID", "The decentralized identity layer for the web.") - @HeroStart() - @HeroSocials() + @layout.Root("Sonr.ID") { + @layout.Container() { + @hero.Title("Sonr.ID", "The decentralized identity layer for the web.") + @hero.Start() + @hero.Socials() } } } templ ReturningView() { - @LayoutView("Login | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Welcome Back!", "Continue with your existing Sonr.ID.") + @layout.Root("Login | Sonr.ID") { + @layout.Container() { + @hero.Title("Welcome Back!", "Continue with your existing Sonr.ID.")
diff --git a/app/views/view_home_templ.go b/x/landing/views/home_templ.go similarity index 85% rename from app/views/view_home_templ.go rename to x/landing/views/home_templ.go index 4d1d3a9..7eb5747 100644 --- a/app/views/view_home_templ.go +++ b/x/landing/views/home_templ.go @@ -8,6 +8,11 @@ package views import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + func InitialView() 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 @@ -53,7 +58,7 @@ func InitialView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -61,7 +66,7 @@ func InitialView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = HeroStart().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Start().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -69,19 +74,19 @@ func InitialView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = HeroSocials().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Socials().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -134,7 +139,7 @@ func ReturningView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Welcome Back!", "Continue with your existing Sonr.ID.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Welcome Back!", "Continue with your existing Sonr.ID.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -144,13 +149,13 @@ func ReturningView() templ.Component { } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/x/landing/views/loading.templ b/x/landing/views/loading.templ new file mode 100644 index 0000000..3074dff --- /dev/null +++ b/x/landing/views/loading.templ @@ -0,0 +1,14 @@ +package views + +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + +templ LoadingView() { + @layout.Root("Loading... | Sonr.ID") { + @layout.Container() { + @hero.Title("Loading Vault", "This will be used to login to your vault.") + } + } +} diff --git a/app/views/view_loading_templ.go b/x/landing/views/loading_templ.go similarity index 84% rename from app/views/view_loading_templ.go rename to x/landing/views/loading_templ.go index 683839f..5fec14a 100644 --- a/app/views/view_loading_templ.go +++ b/x/landing/views/loading_templ.go @@ -8,6 +8,11 @@ package views import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import ( + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/layout" +) + func LoadingView() 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 @@ -53,19 +58,19 @@ func LoadingView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Loading Vault", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Loading Vault", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("Loading... | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Loading... | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/x/landing/views/register.templ b/x/landing/views/register.templ new file mode 100644 index 0000000..6877047 --- /dev/null +++ b/x/landing/views/register.templ @@ -0,0 +1,54 @@ +package views + +import ( + "github.com/onsonr/nebula/ui/card" + "github.com/onsonr/nebula/ui/form" + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/input" + "github.com/onsonr/nebula/ui/layout" + "github.com/onsonr/nebula/ui/slider" +) + +templ RegisterProfileView(firstNumber int, lastNumber int) { + @layout.Root("New Profile | Sonr.ID") { + @layout.Container() { + @hero.Title("Basic Info", "Tell us a little about yourself.") + @form.Root("/register/passkey", "create-profile") { + @form.Body() { + @form.Header() { +
+ +
+ } + @input.HandleInitial() + @slider.HumanInitial(firstNumber, lastNumber) + @form.Footer() { + @form.Cancel() + @form.Submit("Next") + } + } + } + } + } +} + +templ RegisterPasskeyView(address string, handle string, name string, challenge string, creationBlock string) { + @layout.Root("Register | Sonr.ID") { + @layout.Container() { + @hero.Title("Link a PassKey", "This will be used to login to your vault.") + @form.Root("/register/finish", "passkey-form") { + + @form.Body() { + @form.Header() { + @card.CardAccount(address, name, handle, creationBlock) + } + @input.CoinSelect() + @form.Footer() { + @input.PasskeyInitial(address, handle, challenge) + @form.Cancel() + } + } + } + } + } +} diff --git a/app/views/view_register_templ.go b/x/landing/views/register_templ.go similarity index 84% rename from app/views/view_register_templ.go rename to x/landing/views/register_templ.go index bc3aab1..f9ec6f4 100644 --- a/app/views/view_register_templ.go +++ b/x/landing/views/register_templ.go @@ -8,7 +8,14 @@ package views import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "github.com/onsonr/hway/app/islands" +import ( + "github.com/onsonr/nebula/ui/card" + "github.com/onsonr/nebula/ui/form" + "github.com/onsonr/nebula/ui/hero" + "github.com/onsonr/nebula/ui/input" + "github.com/onsonr/nebula/ui/layout" + "github.com/onsonr/nebula/ui/slider" +) func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { @@ -55,7 +62,7 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Basic Info", "Tell us a little about yourself.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Basic Info", "Tell us a little about yourself.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -105,7 +112,7 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { } return nil }) - templ_7745c5c3_Err = FormHeader().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Header().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -113,7 +120,7 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = islands.InputHandle().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = input.HandleInitial().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -121,7 +128,7 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = islands.HumanSlider(firstNumber, lastNumber).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = slider.HumanInitial(firstNumber, lastNumber).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -141,7 +148,7 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = FormCancel().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Cancel().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -149,37 +156,37 @@ func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = FormSubmit("Next").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Submit("Next").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = FormFooter().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Footer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = FormBody().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = Form("/register/passkey", "create-profile").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Root("/register/passkey", "create-profile").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -232,7 +239,7 @@ func RegisterPasskeyView(address string, handle string, name string, challenge s }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Link a PassKey", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = hero.Title("Link a PassKey", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -280,13 +287,13 @@ func RegisterPasskeyView(address string, handle string, name string, challenge s }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = islands.CardAccount(address, name, handle, creationBlock).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = card.CardAccount(address, name, handle, creationBlock).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = FormHeader().Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Header().Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -294,7 +301,7 @@ func RegisterPasskeyView(address string, handle string, name string, challenge s if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = islands.CoinSelect().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = input.CoinSelect().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -314,7 +321,7 @@ func RegisterPasskeyView(address string, handle string, name string, challenge s }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = islands.InputPasskey(address, handle, challenge).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = input.PasskeyInitial(address, handle, challenge).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -322,37 +329,37 @@ func RegisterPasskeyView(address string, handle string, name string, challenge s if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = FormCancel().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Cancel().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = FormFooter().Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Footer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = FormBody().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = Form("/register/finish", "passkey-form").Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = form.Root("/register/finish", "passkey-form").Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = LayoutView("Register | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("Register | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/x/login/handler.go b/x/login/handler.go deleted file mode 100644 index 60a0228..0000000 --- a/x/login/handler.go +++ /dev/null @@ -1 +0,0 @@ -package index diff --git a/x/login/route.go b/x/login/route.go deleted file mode 100644 index 60a0228..0000000 --- a/x/login/route.go +++ /dev/null @@ -1 +0,0 @@ -package index diff --git a/x/oracle/routes.go b/x/oracle/routes.go new file mode 100644 index 0000000..5a6ef42 --- /dev/null +++ b/x/oracle/routes.go @@ -0,0 +1 @@ +package oracle diff --git a/x/register/handler.go b/x/register/handler.go deleted file mode 100644 index 6399f0b..0000000 --- a/x/register/handler.go +++ /dev/null @@ -1 +0,0 @@ -package register diff --git a/x/register/route.go b/x/register/route.go deleted file mode 100644 index 6399f0b..0000000 --- a/x/register/route.go +++ /dev/null @@ -1 +0,0 @@ -package register diff --git a/x/resolver/routes.go b/x/resolver/routes.go new file mode 100644 index 0000000..d356a7b --- /dev/null +++ b/x/resolver/routes.go @@ -0,0 +1 @@ +package resolver