feat(nebula): create Home model for home page

This commit is contained in:
Prad Nukala 2024-10-02 18:01:30 -04:00
parent 3baec2745b
commit 8d8935c045
8 changed files with 25 additions and 12 deletions

View File

@ -94,7 +94,7 @@ endif
install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/sonrd
go install -mod=readonly $(BUILD_FLAGS) ./cmd/motr
go install -mod=readonly $(BUILD_FLAGS) ./cmd/hway
########################################
### Tools & dependencies

View File

@ -0,0 +1,8 @@
// Code generated from Pkl module `models`. DO NOT EDIT.
package models
type Home struct {
Hero *Hero `pkl:"hero"`
Stats *Stats `pkl:"stats"`
}

View File

@ -8,9 +8,7 @@ import (
)
type Models struct {
Hero *Hero `pkl:"hero"`
Stats *Stats `pkl:"stats"`
Home *Home `pkl:"home"`
}
// LoadFromPath loads the pkl module at the given path and evaluates it into a Models

View File

@ -5,6 +5,7 @@ import "github.com/apple/pkl-go/pkl"
func init() {
pkl.RegisterMapping("models", Models{})
pkl.RegisterMapping("models#Home", Home{})
pkl.RegisterMapping("models#Hero", Hero{})
pkl.RegisterMapping("models#Button", Button{})
pkl.RegisterMapping("models#Image", Image{})

View File

@ -28,3 +28,8 @@ stats = new Stats {
thirdValue = "1.5M+";
thirdLabel = "Assets packed with power beyond your imagination.";
};
home = new Home {
hero = hero;
stats = stats;
};

View File

@ -2,6 +2,7 @@ package pages
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/nebula/components/home"
"github.com/onsonr/sonr/pkg/nebula/models"
)
@ -11,5 +12,5 @@ func Home(c echo.Context) error {
if err != nil {
return err
}
return echoResponse(c, home.View(mdls.Hero))
return echoResponse(c, home.View(mdls.Home.Hero))
}

View File

@ -74,8 +74,12 @@ class Footer {
resourcesLinks: List<Link>
}
class Home {
hero: Hero
stats: Stats
}
home : Home
// ╭───────────────────────────────────────────────────────────╮
// │ Registration Components │

View File

@ -8,6 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ipfs/boxo/path"
"github.com/ipfs/kubo/client/rpc"
"github.com/onsonr/sonr/x/vault/types"
)
@ -74,8 +75,3 @@ func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) {
}
return true, nil
}
// validateSubjectOrigin checks if the subject and origin are valid
func (k Keeper) validateSubjectOrigin(ctx sdk.Context, subject string, origin string) error {
return nil
}