Skip to content

Commit

Permalink
feat: adding navbar components
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed May 21, 2024
1 parent 8ea6b65 commit 3d98c89
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/zscaler.crt

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install protobuf-compiler
# && apt-get -y install protobuf-compiler
73 changes: 73 additions & 0 deletions components/navbars/navbars.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package navbars

import htmx "github.com/zeiss/fiber-htmx"

// NavbarProps are the properties of the Navbar component
type NavbarProps struct {
ClassNames htmx.ClassNames
}

// Navbar represents a Daisy UI Navbar component.
// see: https://daisyui.com/components/navbar
func Navbar(props NavbarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.Merge(
htmx.ClassNames{
"navbar": true,
"bg-base-100": true,
},
),
htmx.Group(children...),
)
}

// NavbarStartProps represents the properties of the NavbarStart component
type NavbarStartProps struct {
ClassNames htmx.ClassNames
}

// NavbarStart represents a Daisy UI NavbarStart component.
func NavbarStart(props NavbarStartProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.Merge(
htmx.ClassNames{
"navbar-start": true,
},
),
htmx.Group(children...),
)
}

// NavbarCenterProps are the properties of the NavbarCenter component
type NavbarCenterProps struct {
ClassNames htmx.ClassNames
}

// NavbarCenter represents a Daisy UI NavbarCenter component.
func NavbarCenter(props NavbarCenterProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.Merge(
htmx.ClassNames{
"navbar-center": true,
},
),
htmx.Group(children...),
)
}

// NavbarEndProps are the properties of the NavbarEnd component
type NavbarEndProps struct {
ClassNames htmx.ClassNames
}

// NavbarEnd represents a Daisy UI NavbarEnd component.
func NavbarEnd(props NavbarEndProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.Merge(
htmx.ClassNames{
"navbar-end": true,
},
),
htmx.Group(children...),
)
}

0 comments on commit 3d98c89

Please sign in to comment.