Added documentation to functions and basic JWT generation
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package nav
|
||||
|
||||
type NavItem struct {
|
||||
name string
|
||||
href string
|
||||
name string // Label to display
|
||||
href string // Link reference
|
||||
}
|
||||
|
||||
// Return the list of navbar links
|
||||
func getNavItems() []NavItem {
|
||||
return []NavItem{
|
||||
{
|
||||
@@ -14,6 +15,7 @@ func getNavItems() []NavItem {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the navbar template fragment
|
||||
templ Navbar() {
|
||||
{{ navItems := getNavItems() }}
|
||||
<div x-data="{ open: false }">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package nav
|
||||
|
||||
// Returns the left portion of the navbar
|
||||
templ navLeft(navItems []NavItem) {
|
||||
<nav aria-label="Global" class="hidden sm:block">
|
||||
<ul class="flex items-center gap-6 text-xl">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package nav
|
||||
|
||||
// Returns the right portion of the navbar
|
||||
templ navRight() {
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="sm:flex sm:gap-2">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package nav
|
||||
|
||||
// Returns the mobile version of the navbar thats only visible when activated
|
||||
templ sideNav(navItems []NavItem) {
|
||||
<div
|
||||
x-show="open"
|
||||
|
||||
Reference in New Issue
Block a user