diff --git a/README.md b/README.md new file mode 100644 index 0000000..aee9cff --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Develop + +```sh +docker compose run --rm node yarn install +docker compose up --build +``` diff --git a/components/application/application.templ b/components/application/application.templ index b332439..b0835f0 100644 --- a/components/application/application.templ +++ b/components/application/application.templ @@ -1,12 +1,32 @@ package application -import ( - "gitlab.unjx.de/flohoss/godash/services" -) +import "gitlab.unjx.de/flohoss/godash/services" +import "html/template" + +var ImageTemplate = template.Must(template.New("bar").Parse("
")) + +type Bar struct { + Background string + Icon string +} + +func backgroundColor(config string) string { + result := "p-[0.05rem] " + switch config { + case "dark": + return result + "bg-black " + case "light": + return result + "bg-white " + case "base": + return result + "bg-base-300 " + default: + return "" + } +} templ Application(application services.Application) { - + @templ.FromGoHTML(ImageTemplate, Bar{Background: backgroundColor(application.Background), Icon: application.Icon})