From 965d3230a162edee03ae10385790ac918cbe5bf1 Mon Sep 17 00:00:00 2001 From: Christian Ditaputratama Date: Wed, 30 Oct 2024 15:39:01 +0700 Subject: [PATCH] feat: Added navbar current page position indicator --- internal/handler/views/layout.templ | 2 +- internal/handler/views/layout_templ.go | 2 +- internal/handler/views/partial_navbar.templ | 26 +++++++++++--- .../handler/views/partial_navbar_templ.go | 34 +++++++++++++++++-- internal/handler/views/src/css/main.css | 8 +++++ 5 files changed, 64 insertions(+), 8 deletions(-) diff --git a/internal/handler/views/layout.templ b/internal/handler/views/layout.templ index 0441799..58062c3 100644 --- a/internal/handler/views/layout.templ +++ b/internal/handler/views/layout.templ @@ -42,7 +42,7 @@ templ base(m Meta) { - @navbar() + @navbar(m.Identifier)
{ children... }
diff --git a/internal/handler/views/layout_templ.go b/internal/handler/views/layout_templ.go index fcd4ec4..c3e083e 100644 --- a/internal/handler/views/layout_templ.go +++ b/internal/handler/views/layout_templ.go @@ -193,7 +193,7 @@ func base(m Meta) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = navbar().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = navbar(m.Identifier).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/handler/views/partial_navbar.templ b/internal/handler/views/partial_navbar.templ index 5d971d4..f460c8e 100644 --- a/internal/handler/views/partial_navbar.templ +++ b/internal/handler/views/partial_navbar.templ @@ -1,6 +1,6 @@ package views -templ navbar() { +templ navbar(pageIdentifier string) {