diff --git a/components/layouts/default.templ b/components/layouts/default.templ index 6105124..85bf4f7 100644 --- a/components/layouts/default.templ +++ b/components/layouts/default.templ @@ -2,7 +2,7 @@ package layouts import "dankmuzikk/components/ui/header" -templ Default(children ...templ.Component) { +templ Default(isMobile bool, children ...templ.Component) { @@ -51,7 +51,7 @@ templ Default(children ...templ.Component) { min-height: 100dvh; ' > - @header.Header() + @header.Header(isMobile) for _, child := range children { @child } diff --git a/components/pages/index.templ b/components/pages/index.templ index 38ca823..ed9f7e7 100644 --- a/components/pages/index.templ +++ b/components/pages/index.templ @@ -2,8 +2,8 @@ package pages import "dankmuzikk/components/layouts" -templ Index() { - @layouts.Default(main()) +templ Index(isMobile bool) { + @layouts.Default(isMobile, main()) } templ main() { diff --git a/components/ui/header/header.templ b/components/ui/header/header.templ index 88deed2..66a3a39 100644 --- a/components/ui/header/header.templ +++ b/components/ui/header/header.templ @@ -3,8 +3,27 @@ package header import "dankmuzikk/components/ui/search" templ mobileHeader() { -
- mobile +
+ +
+

+ Hey, +
+ Wanna play some tunes? +

+
+
+ @search.Search() +
} @@ -31,9 +50,12 @@ templ desktopHeader() {
} -templ Header() { +templ Header(isMobile bool) {
- @mobileHeader() - @desktopHeader() + if isMobile { + @mobileHeader() + } else { + @desktopHeader() + }
} diff --git a/components/ui/search/search.templ b/components/ui/search/search.templ index 59455ed..e57f2f7 100644 --- a/components/ui/search/search.templ +++ b/components/ui/search/search.templ @@ -1,7 +1,7 @@ package search templ Search() { -
+
-
+
//