templ per komponen, scroll horizontal

This commit is contained in:
sindhu
2024-04-26 17:01:41 +07:00
parent 99d7fd5159
commit b9108efb25
6 changed files with 1458 additions and 204 deletions

View File

@@ -0,0 +1,33 @@
package handlers
import (
"github.com/a-h/templ"
landingpage "github.com/emarifer/go-templ-project-structure/views/landing_page"
"github.com/labstack/echo/v4"
)
type LandingPageService interface {
}
func NewLandingPageHandler(us LandingPageService) *LandingPageHandler {
return &LandingPageHandler{
LandingPageService: us,
}
}
type LandingPageHandler struct {
LandingPageService LandingPageService
}
func (uh *LandingPageHandler) LandingPage(c echo.Context) error {
// lp := landingpage.ShowLandingPage("Westerindo", landingpage.WrapperLandingPage(landingpage.NavbarLandingPage()), landingpage.CssLandingPage(), landingpage.JsLandingPage())
lp := landingpage.ShowLandingPage("Westerindo", landingpage.LandingPageMain(landingpage.WrapperLandingPage(landingpage.NavbarLandingPage(), landingpage.JumbotronLandingPage(), landingpage.OurMedicalServices(), landingpage.WhyWesterIndoLandingPage(), landingpage.PromotionLandingPage()), landingpage.FooterLandingPage()), landingpage.CssLandingPage(), landingpage.JsLandingPage())
return uh.View(c, lp)
}
func (uh *LandingPageHandler) View(c echo.Context, cmp templ.Component) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
return cmp.Render(c.Request().Context(), c.Response().Writer)
}

View File

@@ -8,6 +8,10 @@ func SetupRoutes(app *echo.Echo, h *UserHandler) {
group.GET("", h.HandlerShowUsers)
group.GET("/details/:id", h.HandlerShowUserById)
// Landing page
lp := LandingPageHandler{}
groupLandingPage := app.Group("/landingpage")
groupLandingPage.GET("", lp.LandingPage)
}
//PLAYGROUND TESTING