fix sveltekit load / preload bug on logout
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user