mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
fix: update hero image height in config.pkl
This commit is contained in:
parent
36ad1448df
commit
bfa78063a7
@ -16,7 +16,7 @@ hero = new Hero {
|
||||
image = new Image {
|
||||
src = "https://cdn.sonr.id/img/hero-clipped.svg";
|
||||
width = "560";
|
||||
height = "560;
|
||||
height = "560";
|
||||
};
|
||||
};
|
||||
|
||||
|
40
pkg/nebula/models/formstate/FormState.pkl.go
Normal file
40
pkg/nebula/models/formstate/FormState.pkl.go
Normal file
@ -0,0 +1,40 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package formstate
|
||||
|
||||
import (
|
||||
"encoding"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type FormState string
|
||||
|
||||
const (
|
||||
Initial FormState = "initial"
|
||||
Error FormState = "error"
|
||||
Success FormState = "success"
|
||||
Warning FormState = "warning"
|
||||
)
|
||||
|
||||
// String returns the string representation of FormState
|
||||
func (rcv FormState) String() string {
|
||||
return string(rcv)
|
||||
}
|
||||
|
||||
var _ encoding.BinaryUnmarshaler = new(FormState)
|
||||
|
||||
// UnmarshalBinary implements encoding.BinaryUnmarshaler for FormState.
|
||||
func (rcv *FormState) UnmarshalBinary(data []byte) error {
|
||||
switch str := string(data); str {
|
||||
case "initial":
|
||||
*rcv = Initial
|
||||
case "error":
|
||||
*rcv = Error
|
||||
case "success":
|
||||
*rcv = Success
|
||||
case "warning":
|
||||
*rcv = Warning
|
||||
default:
|
||||
return fmt.Errorf(`illegal: "%s" is not a valid FormState`, str)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -15,7 +15,7 @@ import (
|
||||
var embeddedFiles embed.FS
|
||||
|
||||
//go:embed assets/config.pkl
|
||||
var config string
|
||||
var config []byte
|
||||
|
||||
func getHTTPFS() (http.FileSystem, error) {
|
||||
fsys, err := fs.Sub(embeddedFiles, "assets")
|
||||
@ -27,7 +27,7 @@ func getHTTPFS() (http.FileSystem, error) {
|
||||
|
||||
// UseAssets is a middleware that serves static files from the embedded assets
|
||||
func UseAssets(e *echo.Echo) error {
|
||||
err := models.LoadFromString(context.Background(), config)
|
||||
err := models.LoadFromString(context.Background(), string(config))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -38,5 +38,10 @@ func UseAssets(e *echo.Echo) error {
|
||||
assets := http.FileServer(fsys)
|
||||
e.GET("/", echo.WrapHandler(assets))
|
||||
e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets)))
|
||||
e.GET("/_nebula/config", handleGetConfig)
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleGetConfig(c echo.Context) error {
|
||||
return c.Blob(http.StatusOK, "application/octet-stream", config)
|
||||
}
|
||||
|
@ -3,15 +3,7 @@ package pages
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/blocks"
|
||||
)
|
||||
|
||||
type FormState string
|
||||
|
||||
const (
|
||||
InitialForm FormState = "initial"
|
||||
ErrorForm FormState = "error"
|
||||
SuccessForm FormState = "success"
|
||||
WarningForm FormState = "warning"
|
||||
"github.com/onsonr/sonr/pkg/nebula/models/formstate"
|
||||
)
|
||||
|
||||
func Register(c echo.Context) error {
|
||||
@ -24,7 +16,7 @@ templ registerView(c echo.Context) {
|
||||
@blocks.H2("Account Registration")
|
||||
@blocks.Spacer()
|
||||
@blocks.Breadcrumbs()
|
||||
@basicInfoForm(InitialForm)
|
||||
@basicInfoForm(formstate.Initial)
|
||||
@blocks.Spacer()
|
||||
@blocks.Button(blocks.GET("/", "#register-view")) {
|
||||
@blocks.Text("Cancel")
|
||||
@ -33,7 +25,7 @@ templ registerView(c echo.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
templ basicInfoForm(state FormState) {
|
||||
templ basicInfoForm(state formstate.FormState) {
|
||||
switch (state) {
|
||||
default:
|
||||
<div class="border rounded-lg shadow-sm bg-card text-neutral-900">
|
||||
|
@ -11,15 +11,7 @@ import templruntime "github.com/a-h/templ/runtime"
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/blocks"
|
||||
)
|
||||
|
||||
type FormState string
|
||||
|
||||
const (
|
||||
InitialForm FormState = "initial"
|
||||
ErrorForm FormState = "error"
|
||||
SuccessForm FormState = "success"
|
||||
WarningForm FormState = "warning"
|
||||
"github.com/onsonr/sonr/pkg/nebula/models/formstate"
|
||||
)
|
||||
|
||||
func Register(c echo.Context) error {
|
||||
@ -95,7 +87,7 @@ func registerView(c echo.Context) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = basicInfoForm(InitialForm).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = basicInfoForm(formstate.Initial).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@ -149,7 +141,7 @@ func registerView(c echo.Context) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func basicInfoForm(state FormState) templ.Component {
|
||||
func basicInfoForm(state formstate.FormState) 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 {
|
||||
|
@ -4,6 +4,8 @@ module models
|
||||
|
||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||
|
||||
typealias FormState = "initial" | "error" | "success" | "warning"
|
||||
|
||||
class Image {
|
||||
src: String
|
||||
width: String
|
||||
|
Loading…
x
Reference in New Issue
Block a user