feat(budget): further improvements
Some checks failed
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Failing after 1m11s
Some checks failed
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Failing after 1m11s
This commit is contained in:
13
internal/core/breadcrumb.templ
Normal file
13
internal/core/breadcrumb.templ
Normal file
@@ -0,0 +1,13 @@
|
||||
package core
|
||||
|
||||
templ Breadcrumb(elements []string, links []string) {
|
||||
<div class="flex gap-5 mb-10 text-lg items-center">
|
||||
for i, element := range(elements) {
|
||||
if (i>0) {
|
||||
<span class="text-gray-500">></span><a class="p-2 decoration-yellow-400 decoration-[0.25rem] hover:bg-gray-200 rounded-lg hover:underline" href={ links[i] }>{ element }</a>
|
||||
} else {
|
||||
<a class="p-2 decoration-yellow-400 decoration-[0.25rem] hover:bg-gray-200 rounded-lg hover:underline" href={ links[i] }>{ element }</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
package core
|
||||
|
||||
import "spend-sparrow/internal/template/svg"
|
||||
import (
|
||||
"spend-sparrow/internal/template/svg"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func layoutLinkClass(isActive bool) string {
|
||||
common := "text-2xl p-2 text-gray-900 decoration-yellow-400 decoration-[0.25rem] hover:bg-gray-200 rounded-lg"
|
||||
@@ -37,7 +40,6 @@ templ Layout(slot templ.Component, user templ.Component, loggedIn bool, path str
|
||||
<script src="/static/js/dashboard.js" defer></script>
|
||||
</head>
|
||||
<body hx-headers='{"Csrf-Token": "CSRF_TOKEN"}'>
|
||||
<div id="dialogContainer"></div>
|
||||
<div class="flex flex-col min-h-screen">
|
||||
<header class="sticky top-0 z-50 bg-white flex items-center gap-6 p-4 border-b-1 border-gray-200">
|
||||
<button id="menuButton" class="w-10 h-10 block xl:hidden">
|
||||
@@ -88,10 +90,10 @@ templ Layout(slot templ.Component, user templ.Component, loggedIn bool, path str
|
||||
|
||||
templ navigation(path string) {
|
||||
<nav class="w-64 text-nowrap flex gap-2 flex-col text-lg mt-5 px-5 pt-2">
|
||||
<a class={ layoutLinkClass(path == "/dashboard") } href="/dashboard">Dashboard</a>
|
||||
<a class={ layoutLinkClass(path == "/transaction") } href="/transaction">Transaction</a>
|
||||
<a class={ layoutLinkClass(path == "/treasurechest") } href="/treasurechest">Treasure Chest</a>
|
||||
<a class={ layoutLinkClass(path == "/account") } href="/account">Account</a>
|
||||
<a class={ layoutLinkClass(path == "/budget") } href="/budget">Budget</a>
|
||||
<a class={ layoutLinkClass(strings.HasPrefix(path, "/dashboard")) } href="/dashboard">Dashboard</a>
|
||||
<a class={ layoutLinkClass(strings.HasPrefix(path, "/transaction")) } href="/transaction">Transaction</a>
|
||||
<a class={ layoutLinkClass(strings.HasPrefix(path, "/treasurechest")) } href="/treasurechest">Treasure Chest</a>
|
||||
<a class={ layoutLinkClass(strings.HasPrefix(path, "/account")) } href="/account">Account</a>
|
||||
<a class={ layoutLinkClass(strings.HasPrefix(path, "/budget")) } href="/budget">Budget</a>
|
||||
</nav>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user