mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat: add static hero section content to homepage
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/home/sections"
|
||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/home/sections"
|
||||
"github.com/onsonr/sonr/pkg/nebula/models"
|
||||
)
|
||||
|
||||
templ View(home *models.Home) {
|
||||
templ View() {
|
||||
@styles.LayoutNoBody("Sonr.ID", true) {
|
||||
@sections.Header()
|
||||
@sections.SectionHero(home.Hero)
|
||||
@sections.Highlights()
|
||||
@sections.Features()
|
||||
@sections.Bento()
|
||||
|
||||
@@ -11,10 +11,9 @@ import templruntime "github.com/a-h/templ/runtime"
|
||||
import (
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/home/sections"
|
||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||
"github.com/onsonr/sonr/pkg/nebula/models"
|
||||
)
|
||||
|
||||
func View(home *models.Home) templ.Component {
|
||||
func View() 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 {
|
||||
@@ -55,14 +54,6 @@ func View(home *models.Home) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = sections.SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = sections.Highlights().Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -1,15 +1,34 @@
|
||||
package home
|
||||
|
||||
import (
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/home/sections"
|
||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/home/sections"
|
||||
"github.com/onsonr/sonr/pkg/nebula/models"
|
||||
)
|
||||
|
||||
templ View(home *models.Home) {
|
||||
var hero = models.Hero{
|
||||
TitleFirst: "Simplified",
|
||||
TitleEmphasis: "self-custody",
|
||||
TitleSecond: "for everyone",
|
||||
Subtitle: "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty.",
|
||||
PrimaryButton: &models.Button{Text: "Get Started", Href: "/register"},
|
||||
SecondaryButton: &models.Button{Text: "Learn More", Href: "/about"},
|
||||
Image: &models.Image{
|
||||
Src: "https://cdn.sonr.id/img/hero-clipped.svg",
|
||||
Width: "500",
|
||||
Height: "500",
|
||||
},
|
||||
Stats: []*models.Stat{
|
||||
{Value: "476K", Label: "Assets packed with power beyond your imagination."},
|
||||
{Value: "1.44K", Label: "Assets packed with power beyond your imagination."},
|
||||
{Value: "1.5M+", Label: "Assets packed with power beyond your imagination."},
|
||||
},
|
||||
}
|
||||
|
||||
templ View() {
|
||||
@styles.LayoutNoBody("Sonr.ID", true) {
|
||||
@sections.Header()
|
||||
@sections.SectionHero(home.Hero)
|
||||
@sections.SectionHero(&hero)
|
||||
@sections.Highlights()
|
||||
@sections.Features()
|
||||
@sections.Bento()
|
||||
|
||||
@@ -14,7 +14,26 @@ import (
|
||||
"github.com/onsonr/sonr/pkg/nebula/models"
|
||||
)
|
||||
|
||||
func View(home *models.Home) templ.Component {
|
||||
var hero = models.Hero{
|
||||
TitleFirst: "Simplified",
|
||||
TitleEmphasis: "self-custody",
|
||||
TitleSecond: "for everyone",
|
||||
Subtitle: "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty.",
|
||||
PrimaryButton: &models.Button{Text: "Get Started", Href: "/register"},
|
||||
SecondaryButton: &models.Button{Text: "Learn More", Href: "/about"},
|
||||
Image: &models.Image{
|
||||
Src: "https://cdn.sonr.id/img/hero-clipped.svg",
|
||||
Width: "500",
|
||||
Height: "500",
|
||||
},
|
||||
Stats: []*models.Stat{
|
||||
{Value: "476K", Label: "Assets packed with power beyond your imagination."},
|
||||
{Value: "1.44K", Label: "Assets packed with power beyond your imagination."},
|
||||
{Value: "1.5M+", Label: "Assets packed with power beyond your imagination."},
|
||||
},
|
||||
}
|
||||
|
||||
func View() 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 {
|
||||
@@ -55,7 +74,7 @@ func View(home *models.Home) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = sections.SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = sections.SectionHero(&hero).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -90,11 +90,11 @@ func SectionHero(hero *models.Hero) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ui.PrimaryButton(hero.PrimaryButton.Href, hero.PrimaryButton.Text).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = ui.PrimaryButton("/register", "Get Started").Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ui.SecondaryButton(hero.SecondaryButton.Href, hero.SecondaryButton.Text).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = ui.SecondaryButton("/about", "Learn More").Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user