templ per komponen, scroll horizontal
This commit is contained in:
33
handlers/landingpage.handlers.go
Normal file
33
handlers/landingpage.handlers.go
Normal 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)
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user