diff --git a/view/component/nav/navbarright.templ b/view/component/nav/navbarright.templ index 41110c7..1dbb11b 100644 --- a/view/component/nav/navbarright.templ +++ b/view/component/nav/navbarright.templ @@ -2,19 +2,83 @@ package nav import "projectreshoot/contexts" +type ProfileItem struct { + name string // Label to display + href string // Link reference +} + +// Return the list of profile links +func getProfileItems() []ProfileItem { + return []ProfileItem{ + { + name: "Profile", + href: "/profile", + }, + { + name: "Account", + href: "/account", + }, + } +} + // Returns the right portion of the navbar templ navRight() { {{ user := contexts.GetUser(ctx) }} + {{ items := getProfileItems() }}
if user != nil { - +
+
+ +
+ +
} else {
+ href="/register" + > + Register + + + +
+ } }