fix sveltekit load / preload bug on logout

This commit is contained in:
JCEEE
2026-09-08 19:05:04 +01:00
parent de6047f406
commit 6ed1805884
3 changed files with 62 additions and 15 deletions
+25 -4
View File
@@ -68,10 +68,19 @@
<div class="sidebar-footer">
{#each footerItems as item}
<a href={item.href} class="nav-item">
{@html item.icon}
<span class="nav-label">{item.label}</span>
</a>
{#if item.href === '/logout'}
<form method="POST" action="/logout" class="nav-item-form">
<button type="submit" class="nav-item nav-item-button" aria-label="Log out">
{@html item.icon}
<span class="nav-label">{item.label}</span>
</button>
</form>
{:else}
<a href={item.href} class="nav-item">
{@html item.icon}
<span class="nav-label">{item.label}</span>
</a>
{/if}
{/each}
</div>
</aside>
@@ -143,6 +152,18 @@
background: #3730a3;
color: #e0e7ff;
}
.nav-item-form {
margin: 0 0.3rem;
}
.nav-item-button {
font-family: inherit;
background: none;
border: none;
box-sizing: border-box;
text-align: left;
cursor: pointer;
width: 100%;
}
.nav-item.active {
background: #4338ca;
color: #fff;